Page MenuHomePhabricator

Ensure {text-domain}/w/load.php requests do not bypass cache for session cookies
Closed, ResolvedPublic

Description

With recent efforts to further the demise of bits.wikimedia.org (per T94896), we should double-check that we uphold as much of the performant aspects of bits.wikimedia.org as possible.

Mainly:

  1. Cookies must not cause users to bypass caching proxies. (E.g. on regular page views for text servers, logged-in users with session cookies bypass varnish).
  2. Cookies are not sent alongside each request.

Point #2 is almost certainly not possible. But #1 is. We should make sure that logged-in users still benefit varnish caching on /w/load.php like before.

Event Timeline

Krinkle raised the priority of this task from to Needs Triage.
Krinkle updated the task description. (Show Details)
Krinkle added subscribers: Krinkle, aaron, ori.
Krinkle renamed this task from Ensure cache responses for requests by logged-in users to {text-domain}/w/load.php to Ensure {text-domain}/w/load.php requests do not bypass cache for session cookies.Jun 11 2015, 7:36 PM

+1 that this is currently an issue I think, and we should address it with some VCL changes...

  1. In static-hash.inc.vcl.erb, we exclude the hostname from hashes on ^/(w/)?static, because we expect static URLs to be invariant across wikis - this makes me wonder if we should be host-invariant on load.php as well?
  2. We should probably exclude both static and /w/load.php from the session/token cookie cache-suppression stuff.
  1. In static-hash.inc.vcl.erb, we exclude the hostname from hashes on ^/(w/)?static [..] this makes me wonder if we should be host-invariant on load.php as well?

Must certainly not. Each wiki has its own module configuration. Different gadgets, extensions, skins, default skin, default language. Also users have different user preferences, and different pages that generate content composed as part of those modules. The message cache is also per-wiki (not to confuse with the localisation cache behind that which doesn't contain local-wiki message overrides).

Ignoring the user content and per-wiki message changes, the module scripts and styles from core would be the same. However even that isn't entirely true since even if the module content is the same, the startup module shouldn't be polluted with extensions from other wikis (the same way that extensions not installed on a wiki are not included at run time server-side and thus not available in the autoloader).

They also need to vary by wmf-branch / mediawiki version, but that could be worked around.

Change 219108 had a related patch set uploaded (by BBlack):
Exclude /w/load.php and /static/ from session/token no-cache stuff

https://gerrit.wikimedia.org/r/219108

Change 219108 merged by BBlack:
Exclude /w/load.php and /static/ from session/token no-cache stuff

https://gerrit.wikimedia.org/r/219108

Krinkle claimed this task.