Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to figure out a caching issue. We are currently using a CMS with built in caching. We can then delete the cached copy via the control panel and the uncached page will be served until we cache that page again.

Long story short, we know that a either a proxy server or load balancer was put in place, and we think that it is caching the pages as well as the CMS. Our specific issue is that when we un-cache the page in the CMS, it's taking 15 minutes (timed) to show up un-cached (even after using different browser, clearing the browser cache, etc.), when prior to the network appliance being introduced, the un-cached page would show up immediately. Unfortunately we don't have any historical response headers saved anywhere.

When we believe that the page is being cached by the proxy/lb, the Response header is returning:

HTTP/1.1 304 Not Modified
Server: Apache/2.0.59 (Unix) JRun/4.0 mod_ssl/2.0.59 OpenSSL/0.9.8k PHP/5.2.6
Last-Modified: Fri, 03 Aug 2012 13:29:12 GMT
Etag: "92fe-18f7-837ada00"
Accept-Ranges: bytes
Keep-Alive: timeout=5, max=100
Content-Type: text/html
Content-Encoding: gzip
Connection: Keep-Alive 
Date: Mon, 06 Aug 2012 13:49:40 GMT
X-Cntnt-Length: 6391

When it's not being cached by the CMS, the response headers are:

HTTP/1.0 200 OK
Date: Mon, 06 Aug 2012 14:03:59 GMT
Server: Apache/2.0.59 (Unix) JRun/4.0 mod_ssl/2.0.59 OpenSSL/0.9.8k PHP/5.2.6
X-Powered-By: PHP/5.2.6
Set-Cookie: blah-blah-blah
Expires: Mon, 26 Jul 1997 05:00:00 GMT
Last-Modified: Mon, 06 Aug 2012 14:04:04 GMT
Pragma: no-cache
Connection: close
Content-Type: text/html

I guess my question is, can Apache2 be configured to return both HTTP 1.0 and 1.1 ? I know the Etag indicates a cached page, and believe it's not available in HTTP/1.0.

Thanks for any insights.

[I originally asked this over on stackoverflow, and it was suggested I ask over here.]

share|improve this question
    
What is your user-agent? –  GioMac Aug 6 '12 at 20:48

2 Answers 2

Your uncached response returns:

X-Powered-By: PHP/5.2.6

This means that it's a page which has been generated by PHP, and this means that your PHP application may have also generated the HTTP/1.0 200 OK. If this is the case, a search for HTTP/1.0 through its source code may reveal the offending code.

share|improve this answer
    
PHP allows you to explicitly set the response code for a request, but this is by no means a requirement. There's nothing here implying that the status code has been set by the PHP application instead of the web server. –  Massimo Aug 6 '12 at 20:40
    
That's a good point. Updated the answer. –  Michael Hampton Aug 6 '12 at 20:43
    
I'll check php config files as I certain that the CMS isn't setting it. Regardless, note that in the (appliance) cached page returns a different HTTP code than the non-cached response. –  dmayo Aug 6 '12 at 23:38
    
It might help if you said which "CMS" and "network appliance" you're using. Remember to edit your question when providing additional information, so that everyone can see it. –  Michael Hampton Aug 6 '12 at 23:45

It's certainly possible a web server could respond with both HTTP 1.0 and HTTP 1.1. For example. You can use web-sniffer.net to confirm this. Test sending a "HTTP 1.0" request to Google.com, and you'll get a 1.0 response back. Test with HTTP 1.1, and you'll get an HTTP 1.1 response back.

If you are setting headers that declare that your content is cachable, it's quite fair that network appliances and users browsers caching as you have declared it's allowed.

A solution to consider is to set the cache times to be low (or off) while you are making changes, so that changes are reflected right away. Then when you are done, turn caching back on, or raise the cache times.

share|improve this answer
    
Thanks for the input. Unfortunately we don't have access to the appliance. We just want to make sure we fully understand what's happening prior to speaking up. I'll go try web-sniffer.net now. –  dmayo Aug 6 '12 at 17:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.