Page MenuHomePhabricator

Improve performance of mobile references API
Closed, DeclinedPublic

Description

The beta version of the mobile site currently defers the loading of references. When a reference is tapped or the reference section (which is initially closed) is opened we make a call to the API to get the reference section. A special page fallback is provided for users without JavaScript.

This change looks like it would save our Russian users alone 123.37 terabytes a year.

The API requested used to pull references dynamically is:
https://en.m.wikipedia.org/w/api.php?action=mobileview&format=json&page=Barack+Obama&sections=references&prop=text&revision=740641055

The problem with this is that this API query is slow. It relies on memcached to work and given the low usage of references usually it works with a cold cache.

Possible solutions

  • I'd be interested in porting this to restbase similar to how you have /remaining and /lead there would also be a third endpoint /references which would only return references sections. I'd suspect this would be beneficial to apps users as well so lets collaborate on making an API that would help us all. MobileFrontend when configured would use Restbase instead of the MobileFrontend API. I see this as a worthwhile activity to allow the mobile site access to Restbase.
  • Identify ways to improve performance of the mediawiki api for large pages

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 22 2016, 6:01 PM
bmansurov triaged this task as Normal priority.Oct 26 2016, 8:24 PM
bmansurov moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

Might be blocked on T146836

Jdlrobson changed the task status from Open to Stalled.Apr 17 2017, 6:02 PM

There is not a public MCS API yet. Even when there is it's not clear if they will be compatible (as the ids may be different).

Jdlrobson renamed this task from MobileFrontend should use MCS for references to Improve performance of mobile references API.May 1 2017, 6:44 PM
Jdlrobson updated the task description. (Show Details)
bearND added a subscriber: bearND.Jun 6 2017, 8:18 PM

it's not clear if they will be compatible (as the ids may be different).

If you use the same revision then the ids should match the rest.

Jdlrobson lowered the priority of this task from Normal to Low.Jul 17 2017, 9:49 PM
Jdlrobson moved this task from Backlog to Later on the Readers-Web-Backlog (Tracking) board.
Jdlrobson closed this task as Declined.Jul 17 2019, 4:15 PM

Lazy loaded reference feature will be removed (see T222373)