Maarten said:
I've got a wiki set up that's reachable under
multiple domain names.
Yeah, just have the JavaScript check which domain is being accessed,
and set the key accordingly.
var key, url = new String(document.location.href);
if (url.match( /^https?://some.domain.com/ ) ) {
key = 'somekey';
} else if (url.match( /^https?://some.other.domain.com/ )) {
key = 'someotherkey';
}
-- Jim R. Wilson (jimbojw)
On 9/25/07, Michael Dale <dale(a)ucsc.edu> wrote:
> 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(a)lists.wikimedia.org
> >
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
> >
>
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l(a)lists.wikimedia.org
>
http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>