[go: up one dir, main page]

Page MenuHomePhabricator

Varnish configuration for mobile domains should be coherent with Apache configuration
Open, MediumPublic

Description

(Copied comment T69015#2248241 by @BBlack)

We should probably look at aligning the varnish mobile-related redirect/rewrite with these changes as well, to avoid gratuitous redirects and rewrites. There are two separate areas in the VCL where this stuff is affected in different ways:

  • The mobile-redirect code:
  • The mobile-rewrite code:
    • Varnish rewrites mobile hostnames to equivalent desktop hostnames
    • It adds X-Subdomain along the way to signal to MobileFrontend that this is a mobile view.
    • This is all in cluster_fe_recv_pre_purge, starting currently around line 78
    • If www.$project is meant to be a desktop view (of HTML that happens to be mobile-friendly, as opposed to MFE), then we should stop doing the hostname-rewrite + X-Subdomain logic on the www names
    • (and the m-dot names too, if they're just going to be apache redirects to the www names).

Event Timeline

Specifically the 3x set req.http.MobileHost regex lines (lines 34-36 currently), they seem to, for some projects at least, redirect e.g. www.$project to m.$project for mobile UAs, which is the inverse of the apache rules above...

Yes, we need to remove the line 34 only, as we indeed redirect the canonical m.<project> to www.<project>, but the other lines are fine as they apply to specific wikis.

Actually, the text-frontend.inc.vcl.erb mobile-redirect code is mostly correct:

regsub(req.http.MobileHost, "^(www\.)?(mediawiki|wikimediafoundation|wikisource|wikidata)\.", "m.\2.");

mediawiki.orgm.mediawiki.orgMobile view exists.
wikimediafoundation.org www.wikimediafoundation.orgNo mobile view for wikimediafoundation.org, so yes we could get rid of this one, but we could also be wiling to enable a m.wikimediafoundation.org mobile view in the future
wikidata.orgm.wikidata.orgMobile view exists.
wikisource.orgm.wikisource.orgMobile view exists. Not a generic portal like other project families but a specific wiki for multilingual wikisource.

No rule there for wikipedia/wikinews/wikiquote/wikiversity/wikibooks/etc.

The swap of Traffic for Traffic-Icebox in this ticket's set of tags was based on a bulk action for all such tickets that haven't been updated in 6 months or more. This does not imply any human judgement about the validity or importance of the task, and is simply the first step in a larger task cleanup effort. Further manual triage and/or requests for updates will happen this month for all such tickets. For more detail, have a look at the extended explanation on the main page of Traffic-Icebox . Thank you!