Page MenuHomePhabricator

Redirect to mobile gateway should be handled on the server-side rather than the client-side
Closed, ResolvedPublic

Description

Right now redirecting mobile users to *.mobile.wikipedia.org is handled by client-side Javascript. Ideally, the redirect should be handled on the server-side (probably by the squid servers or whatever directs requests to the squid servers).

This will make it easier to fix bugs like Bug 23554.


Version: --
Severity: normal

Details

Reference
bz24859

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 21 2014, 11:01 PM
bzimport set Reference to bz24859.

Issue has been raised with the ops team. Waiting to hear back to determine action plan.

Comment from Brion Vibber (via Wikitech-l):
What would be required would be some filtering in the caches to check for particular User-Agents or other settings and send them the redirect directly, or send them through to PHP for possible redirection. (Assuming there's no problem with downstream caching, which I think should usually be ok the way we have things marked -- as long as the redirect responses are marked as private-cache or uncacheable.)

Another config example: http://en.positon.org/post/Squid-26-redirection

The problem is of course that the cookie value needs to be taken into account. Apparently

http://www.squid-cache.org/mail-archive/squid-users/200703/0129.html

might make that possible.

(In reply to comment #2)

Issue has been raised with the ops team. Waiting to hear back to determine
action plan.

RT ticket open about this issue: http://rt.wikimedia.org/Ticket/Display.html?id=196 .

In the meantime we might be able to do the redirect within the resource loader to make the experience a bit faster.

According to Trevor the Resource Loader won't be deployed until mid-November or so. (I'm guessing December.)

Now that the Resource Loader is deployed, this should get much higher priority.

Mobile devices now have to load the entire page, before the mobile redirect script is executed. Making the whole exercise pretty useless, and probably some older devices, won't even reach the bottom of the page.

This is going to be taken care of by the mobile rewrite port. Marking as defendant on Bug #25558.

Looks like were not blocked on the new extension anymore. Thanks to Asher and Patrick we have a list of ACL's that can go directly in to squid. Early production tests picked up more user agents then they should have but we've fixed that up. Production push will be posted on http://wikitech.wikimedia.org/view/Software_deployments as soon as its ready.

Were doing one box testing on the squids right now. If all goes well were aiming to do a full ACL deploy early next week.

Wicked. That will be a nice step forward.

Were still tweaking our regexes so that we don't catch things like API request to EN wiki. If you have any questions send them over to binasher on irc.

afeldman wrote:

The mobile redirect is now being handled by our frontend squids, which are now picking a much larger set of devices. Long live the javascript redirect!