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.

We're running Plone 3.3.6 behind Apache 2.2.19 with mod_cache. We've recently noticed that Apache is caching the 206 response to a range request and then serving that partial response when a request for the full resource is made.

What seems to happen:

  • some client makes a range request for a resource that is not yet in the cache or is in the cache but has expired
  • Apache serves the 206 response correctly
  • another client makes a standard request the same resource
  • Apache serves the same 206 response to this second client: it should serve the entire response with a 200

This is causing problems with our css on some sites very occasionally

I can replicate this consistently: I wrote a little python script to make a range request.

I don't think we're not doing anything out of the ordinary with our Apache configuration. We're using reverse proxy configuration to serve pages from Plone. The Apache configuration relevant to mod_cache is as follows:

CacheEnable disk /
CacheDisable /static
CacheDisable /sitemap.xml.gz
CacheDisable /robots.txt
CacheIgnoreHeaders Set-Cookie

UseCanonicalName On

RequestHeader edit Accept-Encoding ^.*gzip.*$ gzip early
RequestHeader edit Accept-Encoding ^(?!gzip).*$ "" early

The Apache caching guide doesn't include 206 responses in the list of status codes the response "must have" for it to be cached. Is this a bug in Apache or are we doing something wrong in the configuration?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

This is apache bug 49113 and has been fixed in the trunk but not in 2.2.19.

share|improve this answer
    
Good catch - the testing that I had done wasn't with back-end content that was responding with a Cache-Control or Expires header, so I wasn't hitting the flawed logic check. –  Shane Madden Sep 5 '11 at 20:25
    
We’ve patched Apache and this has resolved the issue. I’d have thought this regression serious enough to make it into a 2.2.x build but no sign of that happening –  scarba05 Sep 6 '11 at 8:39
    
Has this been fixed in Ubuntu Lucid's "apache2.2-bin 2.2.14-5ubuntu8.7" (Nov. 3rd 2011)? Can't find any evidence in changelogs... –  Henk Dec 5 '11 at 21:05

This is fixed in Apache 2.2.23. Upgrade to 2.2.23 and you don't need to patch

share|improve this answer

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.