You can configure a zwiki to handle "conditional HTTP Get" requests (aka handling "If-modified-since" headers with 304 reply code when a page has not changed.)

By default conditional HTTP GET requests from browsers are served a 200 response with full content. This is due to wikis often having very non-static content. In order to save some bandwidth and processing power (maybe even RAM?), admins may choose to enable "conditional HTTP GET" for all or part of a site.

Problems with this?

Please see #1316 FireFox doesn't load changes after editing with 304 enabled for some problems you might have with Firefox / Mozilla and a workaround. Also please report any further problems you might have to us!

Enabling it

Set a 'conditional_http_get' boolean property to True. You can do this for all the wiki (by setting it on the folder) or on a per-page basis.

This will enable "conditional HTTP GET" for all pages that are not dtml enabled. This default behaviour can be changed.

Configuring for dynamic content

With relatively static wiki sites the default behaviour is fine. But for very dynamic pages (like the IssueTracker pages), doing "conditional HTTP GET" leads to unexpected results. For example browsers will not try to re-get the contents of the IssueTracker page if only the listed issues have changed, since the "edited time" of the IssueTracker page itself has not changed.

Scenarios for configuration

The following examples give some ideas how to configure your wiki in this respect:

No dtml

If in your wiki you have no dtml allowed, and no IssueTracker, just use the default behaviour. Add the 'conditional_http_get' boolean property to the wiki folder, set it to True.

Some dtml

If your wiki has no dtml allowed in general, but some pages like IssueTracker have allow_dtml on a per-page basis, then you add the 'conditional_http_get' boolean property to the wiki folder, set it to True. The default behaviour is to ignore pages with a property 'allow_dtml' that is set to True. Since your IsssueTracker pages need such a property to work, they are excempt from "conditional HTTP GET" handling.

All dtml

The default behaviour will result in no "conditional HTTP GET" handling if allow_dtml is set for all the wiki. To change this behaviour we suggest two steps:

  • Set a property called 'conditional_http_get_ignore' of type "Lines" on the wiki folder. The code goes through every line of that property and checks if a property by that name is set to a non-False value. If it finds any, it does not do "conditional HTTP GET" handling, instead returning a 200 status response with full content. Normally this list is pre-populated with 'allow_dtml', that's why dtml enabled pages are ignored by default. Setting conditional_http_get_ignore to an empty list enableds "conditional HTTP GET" processing even for dtml enabled pages.
  • If your dynamic pages share a common property, just add that property to the conditional_http_get_ignore list. If not, just give them one. For example add the line 'no_304' to conditional_http_get_ignore. Then add a 'no_304' boolean property to your dynamic pages (e.g. the IssueTracker pages) and set it to True. The pages with that property will now be served with 200 status code and full content, no matter what the "If-modified-since" header from the browser says. The user will get fresh content on every click.

All dtml - all enabled

If your site has dtml enabled everywhere, but you also want "conditional HTTP GET" handling everywhere, this is what you have to do:

  • Set a property called 'conditional_http_get_ignore' of type "Lines" on the wiki folder. The code goes through every line of that property and checks if a property by that name is set to a non-False value. If it finds any, it does not do "conditional HTTP GET" handling, instead returning a 200 status response with full content. Normally this list is pre-populated with 'allow_dtml', that's why dtml enabled pages are ignored by default. Setting conditional_http_get_ignore to an empty list enableds "conditional HTTP GET" processing even for dtml enabled pages.

This will sometimes result in users not seeing changes in dynamic content on some pages. But if your site uses dtml only sparingly and for mostly non-dynamic uses, it might just be what you need.

RSS feeds

The standard Zwiki RSS feeds ANYPAGE/changes_rss and ANYPAGE/pages_rss are "conditional HTTP GET" enabled, if:

  • "conditional HTTP GET" is enabled for all the wiki
  • "conditional HTTP GET" is not disabled for the page that those methods are called on (e.g. ANYPAGE)