This extension seems to call mw.user.sessionId()
unconditionally whenever someone visits a page of the wiki, regardless of whether they're logged in or not.
The effect of this is setting the cookie mwuser-sessionId
(usually prefixed with the wiki's database name), which means that the wiki visitor in question will not be served any cached HTTP content for any further pages they visit!
Wikipedia seems to have a workaround against this as far as I can tell by X-Cache HTTP headers I receive from it, though I couldn't find any documentation as to how it achieves this. A fairly typical Varnish or Nginx caching mechanism will not be accommodating against this, and thus suffer greatly. (In fact, it could be making the HTTP cache nearly useless, though I haven't made measurements; it might still be useful with SEO bots or such at least.)
Even the Varnish configuration recommended on Manual:Varnish caching is suspect to this issue, as the regex used to match session tokens will match mwuser-sessionId
. (EDIT: This may be wrong after all; I had not thought about the equals sign at the end of the regex. Maybe that's the key.)
I wonder if this extension could be modified not to call mw.user.sessionId()
for users that aren't logged in? FYI, the two places in the code that call this are src/actions.js:83
and src/instrumentation/statsv.js:23
.