zope-plone.vcl

Ricardo Newbery ric at digitalmarbles.com
Thu May 1 22:54:11 CEST 2008


Just poking around the tracker and I noticed some activity on the  
example plone vcl.  http://varnish.projects.linpro.no/changeset/2634

Just thought I would chime in that the example has issues.

First of all, it's unnecessary to filter cookie-authenticated requests  
as authenticated responses are already set with a past date Expires  
(although you need to set a default_ttl of zero seconds, http://varnish.projects.linpro.no/ticket/236) 
.  With CacheFu installed, the default policy gives authenticated  
responses a max-age=0.  However, some authenticated responses are  
deliberately cached -- mostly images, javascript and css files.  The  
rule in the example vcl defeats this strategy.

Also, not every non-authenticated item should be set with a minimum  
ttl of 3600 seconds.  CacheFu can't yet purge all items reliably when  
the view changes.  Some view changes may be dependent on changes  
elsewhere in the site which currently is hard to track reliably in the  
general case.  Subsequently, the default policy for some content and  
most container views is to NOT cache in the proxy.  This is easily  
overridden in CacheFu as necessary but again the example vcl defeats  
this strategy.

Also, last I heard Varnish strips the conditionals from conditional  
requests when passed to the backend.  This is unfortunate as one  
default CacheFu policy for private items is to "cache" the items only  
in the browser with conditional requests ensuring freshness.   
Stripping the conditionals defeats this strategy.  The solution is to  
pass the conditionals in the vcl which the example vcl does not do.

IMHO, a better example of a vcl for plone (for varnish trunk or 1.2)  
can be found at:
http://svn.plone.org/svn/collective/buildout/plone.recipe.varnish/trunk/plone/recipe/varnish/template.vcl

Ric









More information about the varnish-misc mailing list