apache mod_cache stores but doesn't serve url with 'Transfer-Encoding: chunked'

486 views Asked by At

I have setup apache2 with django and mod_wsgi in Debian Wheezy. I enabled mod_mem_cache with this configuration:

<IfModule mod_mem_cache.c>
    CacheEnable mem /
    MCacheSize 400000
    MCacheMaxObjectCount 100
    MCacheMinObjectSize 1
    MCacheMaxObjectSize 500000
    CacheIgnoreNoLastMod On
    CacheIgnoreHeaders Set-Cookie
</IfModule>

based on the fact that MCacheMaxStreamingBuffer is the smaller of 100000 or MCacheMaxObjectSize as stated in the docs.

When I try hitting a page with size 3.3KB I get these response headers in firebug:

Connection  Keep-Alive
Content-Encoding    gzip
Content-Type    text/html; charset=utf-8
Date    Wed, 27 Aug 2014 14:47:39 GMT
Keep-Alive  timeout=5, max=100
Server  Apache/2.2.22 (Debian)
Transfer-Encoding   chunked
Vary    Cookie,Accept-Encoding

and the page isn't served from cache. In the page source there is however the correct header 'Cache-Control: max-age=300,must-revalidate' but doesn't show up in firebug. In apache log I only see correctly:

[info] mem_cache: Cached url: https://83.212.**.**/?

With another test page that I created outside of django that doesn't have chunked encoding as a header, caching works fine. Why is the page not served from cache? Has anyone seen something similar?

0

There are 0 answers