Last modified: 2011-03-06 21:18:23 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 27690 - Delayed redirect from main site for mobile users (1.17 regression)
Delayed redirect from main site for mobile users (1.17 regression)
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: High major (vote)
: ---
Assigned To: Hampton Catlin
:
: 27802 27900 (view as bug list)
Depends on:
Blocks: 27339
  Show dependency treegraph
 
Reported: 2011-02-24 19:10 UTC by Hampton Catlin
Modified: 2011-03-06 21:18 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Hampton Catlin 2011-02-24 19:10:23 UTC
The mobile redirect script loads FAR after the rest of the page.

So, on the iphone, even the images in the page (after initial render) finish loading
before the redirect happens.

I have modified the redirect script to be MUCH, MUCH smaller and easier to compress.


After putting the new JS through the http://closure-compiler.appspot.com/home compiler. It ends up being like: 

  if(/(iPhone|iPod|Android.*Mobile|webOS|NetFront|Opera Mini|SEMC-Browser|PlayStation Portable|Nintendo Wii|BlackBerry)/.test(navigator.userAgent))if(document.cookie.indexOf("smr=t")<0&&wgNamespaceNumber>=0&&wgAction=="view"){if(wgPageName!=wgMainPageTitle.replace(/ /g,"_"))wgWikimediaMobileUrl+="/"+encodeURI(wgPageName);document.location=wgWikimediaMobileUrl};

That might work embedded. And we can certainly shorted the Regex to match with less bits.

However, you can solve this a more traditional way, if you like. ;)

-hampton.
Comment 1 Hampton Catlin 2011-02-25 02:42:38 UTC
I'm upgrading this one. Right now, the mobile site experience is seriously degraded. We need a quick fix for this in soon....

On a 3G connection, you wait 15 seconds for the page to fully load... and by that point you are already reading it, when... POP... it redirects you and you have to wait again. :P

A terrible experience.
Comment 2 Derk-Jan Hartman 2011-02-25 08:58:40 UTC
See also bug 24859
Comment 3 Derk-Jan Hartman 2011-03-01 17:58:34 UTC
*** Bug 27802 has been marked as a duplicate of this bug. ***
Comment 4 Terence Eden 2011-03-04 14:14:06 UTC
May I *strongly* suggest that you do not use JavaScript to perform the redirection.  Any device detection should be done server-side.

Many mobile phones - especially those in the developing world - don't have JavaScript, or have non-compliant implementations, or have it switched off for performance reasons.

Even if a device does use JS, it still has to load the entire page of HTML which for many people will be a slow and costly experience.  If people are paying per MB on a GPRS connection, they will not get a great experience.

Best practice would be to use a service like DeviceAtlas (http://deviceatlas.com/) or WURFL (http://wurfl.sourceforge.net/) to parse User Agent strings on the server, then 302 redirect them.

Alternatively, an .htaccess modification would work as well.

I don't know enough about Wikimedia architecture to know which is the best in this case.  What I do know is relying on client-side redirection is not safe.
Comment 5 Sam Reed (reedy) 2011-03-04 14:15:08 UTC
(In reply to comment #4)
> May I *strongly* suggest that you do not use JavaScript to perform the
> redirection.  Any device detection should be done server-side.
> 
> Many mobile phones - especially those in the developing world - don't have
> JavaScript, or have non-compliant implementations, or have it switched off for
> performance reasons.
> 
> Even if a device does use JS, it still has to load the entire page of HTML
> which for many people will be a slow and costly experience.  If people are
> paying per MB on a GPRS connection, they will not get a great experience.
> 
> Best practice would be to use a service like DeviceAtlas
> (http://deviceatlas.com/) or WURFL (http://wurfl.sourceforge.net/) to parse
> User Agent strings on the server, then 302 redirect them.
> 
> Alternatively, an .htaccess modification would work as well.
> 
> I don't know enough about Wikimedia architecture to know which is the best in
> this case.  What I do know is relying on client-side redirection is not safe.

See bug 24859
Comment 6 Hampton Catlin 2011-03-04 14:21:09 UTC
Lets not get distracted from the immediate issue here... we have a broken mobile site...

Its been broken now for 8 days!

-hampton.
Comment 7 Tomasz Finc 2011-03-05 01:25:46 UTC
This has already been mentioned in a couple of places but I'm adding it to the bug for thoroughness. 

@Hampton: According to Trevor we need to modify the startup js file in order to get the redirect to happen early. The file in question is http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/startup

We need you to coordinate with Trevor to find out how to combine the extension WikimediaMobile with this.

Long term we are still blocked on http://rt.wikimedia.org/Ticket/Display.html?id=196 for server side redirection.
Comment 8 Roan Kattouw 2011-03-05 19:26:21 UTC
(In reply to comment #7)
> This has already been mentioned in a couple of places but I'm adding it to the
> bug for thoroughness. 
> 
> @Hampton: According to Trevor we need to modify the startup js file in order to
> get the redirect to happen early. The file in question is
> http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/startup
> 
> We need you to coordinate with Trevor to find out how to combine the extension
> WikimediaMobile with this.
> 
I've live-hacked this, should be fixed now.

> Long term we are still blocked on
> http://rt.wikimedia.org/Ticket/Display.html?id=196 for server side redirection.
RT isn't public, only people who have an account there (certain WMF staff) can read tickets.
Comment 9 Roan Kattouw 2011-03-06 21:18:23 UTC
*** Bug 27900 has been marked as a duplicate of this bug. ***

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links