[Mediawiki-l] adapting MW caching behavior to the domain in the request?

Michael Dale dale at ucsc.edu
Tue Sep 25 06:19:48 UTC 2007


having the skin grab the google key variable from a one-line javascript 
file or a one line modification thats different per domain seems like 
the easiest way...it avoids any changes to the code base and you don't 
store 3 copies of the cache...

--michael

Maarten wrote:
> Hi folks,
>
> A question about MW caching of rendered pages.
>
> I've got a wiki set up that's reachable under multiple domain names.
> MW keeps only one version of each page in the cache and hands visitors
> the cached copy regardless of what domain they come to. For baroque
> reasons, this is causing problems.
>
> Most pages in our wiki contain an instance of the Google Maps
> extension. The Google Maps API requires that the javascript on your
> page pass Google an UUID "API key" that was generated for the domain
> that hosts the page. The extension code will look at the current
> domain name and generate javascript to pass the right key.
>
> However, that javascript code then becomes part of the HTML cached by
> Mediawiki: One visitor fetches the page with a request to
> wiki.domain1.com, and Mediawiki caches the resulting HTML. Next
> visitor arrives with a request to wiki.domain2.com, Mediawiki sees it
> has a cached copy, and hands that over--including the javascript with
> key meant for domain1.com.
>
> I'm curious what the best way is to work around this. I don't want to
> turn off MW's page caching altogether.
>
> Should I patch MediaWiki to consider a cached page invalid if it was
> generated for a request to a different domain?
> Would it work emit move some of the GMaps-related Javascript from the
> skin code, or is HTML generated by the skin also cached?
> Are there other ways to work around this?
>
> Thanks!
>
> Maarten.
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>   




More information about the MediaWiki-l mailing list