Make Moin friendlier to caching proxies

We're using a mod_cache caching proxy in front of our Moin instance at the ASF. The following changes were made to make Moin more cache-friendly:

MoinMoinPatch/moin-cache-friendly.diff is the diff, against current arch (patch 730). - added to moin 1.5 branch

-- JustinMason

One more patch from the Apache install: Add "Vary: Cookie" on all pages to assure that logged-in users get the appropriate content.

Note that while many of the above changes are simply enhancements to allow more-aggressive caching, the two additions to Vary (Cookie and Accept-Language) are necessary to assure the proper content is delivered regardless of the other changes. Without the Vary header, Moin will be broken by any shared cache living between the client and the server. (Also note that, technically, the two Vary headers should be merged into Vary: Cookie, Accept-Language, but servers should fold them together anyway.)

MoinMoinPatch/vary-cookie.diff is the patch to be added to the above. - added to moin 1.5 branch

-- JoshuaSlive

/!\ See parent page for attachments!

Discussion

Docs on the whole matter:

Comments:

  1. Vary should include Cookie, Accept-Language and maybe User-Agent (reason: spider code)
  2. All additional caching headers should maybe be limited to "normal" page views, since those cause the main load; such caution would limit side-effects of wrong header fields (what happens when Vary lies and we use other headers for content negotiation?) The cache-busting stuff does just that, according to its description.
  3. As a precaution, if problem arise for a wiki admin due to caching somewhere he has no control over, maybe add a config value to prevent caching of ALL pages (add no-cache to any content sent).

MoinMoin: MoinMoinPatch/CachingProxies (last edited 2007-10-29 19:13:01 by localhost)