On 30/12/11 14:50, Forest ForTrees wrote:
Varnish uses scripts in a remarkably flexible programming language (called VCL) to determine which files to cache and which to pass to Apache. In particular, it can use PCRE based regexes on http headers to determine how to handle a request. For example, it should be able to look for session, UserID or Token cookies from MediaWiki. If it finds one of these, then it could be configured to pass the request to Apache rather than looking in the cache. However, if those cookies aren't set and the requested resource is in the MediaWiki folder (i.e. the folder in $wgScriptPath), then it could conceivably look for the object in the cache rather than contacting Apache, even if other cookies, such as the Google Analytics or Vector cookies, are set. If the requested resource is in another folder, dif ferent behavior could apply.
MediaWiki can send a header called X-Vary-Options which gives you a list of header substrings to vary the cache on. It is specific to MediaWiki.
http://www.mail-archive.com/squid-dev@squid-cache.org/msg07066.html
A VCL routine which parses this header and uses it to make caching decisions would solve your problem and, if published, would also be useful to other sites using Varnish with MediaWiki.
-- Tim Starling