[GeneralDiscussion] tweaking caching headers

[email protected] (Niall Douglas) Sat, 07 Mar 2009 02:13:56 -0800
Newsgroups gmane.comp.web.zope.zwiki
Message-ID <49B248B6.18237.DCE9332__22081.3124011785$1236420935$gmane$org@s_sourceforge.nedprod.com>
On 6 Mar 2009 at 23:19, simon wrote:

> I am tweaking the caching setup on zwiki.org, so if you notice any bugs
> (stale content when viewing or editing) please let me know. I installed
> Varnish for testing (not yet on port 80). I installed an accelerated
> http cache manager, but I don't think it's associated with anything
> (tried to search for cacheable content, gave up). Then I played around
> with the http headers in ZWikiPage.py. No great speedup yet. I haven't
> gone and studied up on the latest caching techniques, but it looks like
> I'll need to. Unless.. Patches Welcome! 
>
> To be more specific: I also set conditional_http_get=True,
> condition_http_get_ignore=[] on the folder, and I changed the code to
> always set a Cache-Control header.

Firstly make sure you're using v2 of varnish rather than v1. v1 
works, but it has idiosyncracies ...

Secondly, you definitely want the "Live HTTP headers" plugin for 
Firefox. You also want to enable the telnet based "control" port for 
varnish which is very useful for finding out what's going on while it 
runs. I'd use Firefox to inspect the headers coming out of Zope 
directly (before going into varnish) as well as coming out of 
varnish.

Other than that, make sure Zope isn't adding a "Vary" header to zwiki 
output which is preventing caching. The Last-Modified should be 
enough otherwise. As I noted on my "low end Plone VPS" page, the 
speedup is extremely significant once working.

Oh and make sure Advanced HTTP Cache Manager isn't sending purges to 
the control interface for every page. You can check that using the 
control telnet interface.

Good luck!

Niall


--
forwarded from http://zwiki.org/GeneralDiscussion#msg49B248B6.18237.DCE9332@s_sourceforge.nedprod.com