Page MenuHomePhabricator

Fix varnish handling of mobile hostname rewriting
Closed, ResolvedPublic


Currently the way the VCL handles mobile-subdomain requests is that when it detects the mobile subdomain, it does two things in vcl_recv: sets the X-Subdomain header and rewrites to the desktop hostname. Then later in vcl_hash we hash on X-Subdomain to keep the content caches separate. We currently have to eventually rewrite the hostname to the desktop hostname for MediaWiki's purposes, but it's not necessary that it happen in vcl_recv.

If we stick with the current logic, figuring out how to do ban actions on the cache gets complicated. To ban the mobile variant of a given object, we have to remember to ban on the desktop hostname + obj.http.X-Subdomain=.... We could make life simpler by moving the hostname rewrite to the exit side of tier-1 backends as a change to, and then from a cache/ban perspective the objects are properly under the mobile hostnames and we don't need vcl_hash hacks for X-Subdomain either.

Event Timeline

BBlack claimed this task.
BBlack raised the priority of this task from to Medium.
BBlack updated the task description. (Show Details)
BBlack added projects: SRE, Traffic.
BBlack added subscribers: MaxSem, faidon, BBlack, ema.

Change 265271 had a related patch set uploaded (by BBlack):
text VCL: delay mobile hostname rewrites

Change 265271 merged by Ema:
text VCL: delay mobile hostname rewrites