7

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?

scarba05
  • 333
  • 6
  • 15

2 Answers2

4

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

Duncan Harris
  • 216
  • 2
  • 6
  • 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 05 '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 06 '11 at 08: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 05 '11 at 21:05
0

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

scarba05
  • 333
  • 6
  • 15