[GeneralDiscussion] Re: zope/plone article

[email protected] (Niall Douglas) Fri, 06 Mar 2009 06:24:50 -0800
Newsgroups gmane.comp.web.zope.zwiki
Message-ID <49B13217.11471.98E35DB__21238.1868077957$1236349593$gmane$org@s_sourceforge.nedprod.com>
On 5 Mar 2009 at 9:27, Simon Michael wrote:

> Yow.. well if it works, great. :)
> 
> Can you describe briefly the end goal again ?

Yes. The masterinclude file defines a set of links in RST format. All 
other files in the wiki then use those links without having to define 
them individually. Now to update the links one simply changes 
masterinclude and the rest of the wiki updates itself.

I'm kinda surprised this isn't standard functionality in wikis but no 
matter.

I've been doing some performance and speed tests with my brute force 
master inclusion system which of course completely bypasses the zwiki 
prerendering system. I thought I should report my results ...

I am running zwiki on plone but behind a CacheFu controlled "varnish" 
reverse proxy - varnish is very seriously impressive and as I 
mentioned in my "Setting up Plone on a low end VPS" guide, my 
piddling 256Mb RAM VPS can handle being slashdotted (>1000 concurrent 
requests) with varnish running despite it using around 400Mb of RAM 
(192Mb of swap!)

To make use of varnish, you need a minimum of conditional HTTP 
working. I turned on conditional HTTP gets - the zwiki code reports 
the datestamp for the page which is to be expected, but this ignores 
the masterinclude. I can't see any way of overriding this date in the 
zwiki source - would adding this facility be a good idea as who knows 
what templates may do with rendering zwiki pages? If they had a 
publicly available method to call it would be useful.

BTW, you say that conditional GET doesn't work with Firefox so you're 
getting stale content during edits - but you're not sending "Cache-
Control: must-revalidate" like you must if you want Firefox to always 
ask if cached items have been updated. Firefox is standards correct 
here, IE and others are broken: if you return a Last-Modified, the 
browser can not bother requesting anything at all ever again until 
its own cache expires.

In fact, if you want to be *really* sure you have the conditional GET 
correct, this is the fairly standard form:

Cache-Control: max-age=86400, s-maxage=86400, public, must-
revalidate, proxy-revalidate

This sets a maximum age of one day in the cache plus forces a 304 
check for the item each and every time. This will solve your "edits 
in Firefox" problem and you can probably turn on conditional GET by 
default now.

It also solves my masterinclude problem because when I update 
masterinclude, the page cache will always be refreshed once a day.

Cheers,
Niall


--
forwarded from http://zwiki.org/GeneralDiscussion#msg49B13217.11471.98E35DB@s_sourceforge.nedprod.com