Page MenuHomePhabricator

Switching between desktop and mobile view should redirect to canonical URLs
Closed, ResolvedPublic

Description

Currently, it redirects to /w/index.php?title=foo , which results in stale cache:

http://en.m.wikipedia.org/w/index.php?title=Wage_reform_in_the_Soviet_Union,_1956%E2%80%931962
Last-Modified: Mon, 23 Apr 2012 05:59:47 GMT

vs.

http://en.m.wikipedia.org/wiki/Wage_reform_in_the_Soviet_Union,_1956–1962
Last-Modified: Mon, 23 Apr 2012 16:14:15 GMT


Version: unspecified
Severity: normal
See Also:
https://bugzilla.wikimedia.org/show_bug.cgi?id=30772

Details

Reference
bz36182

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 12:20 AM
bzimport set Reference to bz36182.

Any update on this bug? Is this an easy change?

Still not resolved, I see instances when this fix works on live site and some when it doesn't.

Max, can you give examples of where this is not working? One that I found quickly was on pages like:
http://en.wikipedia.org/wiki/Portal:Featured_content
http://en.wikipedia.org/wiki/Wikipedia:About

Is this a namespace related issue?

(In reply to comment #4)

Is this a namespace related issue?

Maybe, I'll need to investigate this.

I think I've resolved this for desktop -> mobile requests that happen on sites that have a mobile URL template defined (eg the WMF cluster): https://gerrit.wikimedia.org/r/#/c/36809/1

This should make all 'mobile view' links canonical, all the time. This should work fine on the WMF cluster which passes all .m traffic through the mobile varnish servers, which will always result in a mobile view (even without ?mobileaction=toggle_mobile_view).

This approach will not work in the reverse (mobile -> desktop view) because we need the mobileaction query param for non-js browsers to set the stopMobileRedirect cookie.