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

bmansurov moved this task from Incoming to Triaged but Future on the Web-Team-Backlog board.
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)

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 Medium to Low.Jul 17 2017, 9:49 PM
Jdlrobson edited projects, added Web-Team-Backlog (Tracking); removed Web-Team-Backlog.
Jdlrobson moved this task from Untriaged to Discuss further on the Web-Team-Backlog (Tracking) board.

Lazy loaded reference feature will be removed (see T222373)