[Setup] Varnish cache does not appear to speed up page delivery

Ricardo Newbery ric at digitalmarbles.com
Wed Mar 4 15:03:19 UTC 2009

On Mar 4, 2009, at 6:44 AM, JimL wrote:

> Thanks Ric,
> this is really helping.
> I've just noticed the:
> Cache-Control: max-age=0, s-maxage=0, private, must-revalidate
> header. I'm no expert on any of this, but from what I've just been  
> reading,
> the max-age=0 means that content is never fresh and Varnish is  
> contacting
> the backend every time (i.e. not caching)?
> Let me know if I'm wrong. If so that would explain why the  
> performance is
> just a tiny bit slower than Plone on its own.
> Cheers,  Jim

For shared caches, both 'private' and 's-maxage' take precedence over  
'maxage' but the practical effect is the same.  This response is never  
stored in shared caches.  It can be stored in the browser cache but is  
immediately stale (because of 'maxage') which forces a validation  
header on the next request.

This is the set of headers that you get with CacheFu.  The page  
matches the 'plone-content-types' cache rule, which delegates  
authenticated requests to 'cache-in-memory' and anonymous to 'cache- 
with-etag'.  Take a look at both header sets in the CacheFu control  
panel and you'll see all those cache-control tokens set.

The tiny performance difference may just be the extra hop that varnish  
introduces into the chain.  Not usually significant and as Martin  
already pointed out, more than offset by the speedup of the varnish- 
cached resources like inline images, css, and javascript.


More information about the Setup mailing list