Page MenuHomePhabricator

Spike - Optimize API calls made on Special:ReadingLists page
Open, MediumPublic3 Estimated Story Points

Description

Currently, there are multiple API calls when loading the special page:

  1. There is an API call to get the list of pages in the reading list http://enwiki.mediawiki.mwdd.localhost:8080/w/api.php?action=query&format=json&list=readinglistentries&rlelists=4&rlesort=updated&rledir=descending&rlelimit=12&formatversion=2
  2. Then calls for page metadata https://en.wikipedia.beta.wmcloud.org/w/api.php?action=query&format=json&origin=*&prop=info%7Cdescription%7Cpageimages&titles=Capitol_View%2C_Atlanta%7CCanton_of_Rozoy-sur-Serre%7CCaptain_Feathersword%7CChildren_of_Henry_VIII%7CWales%7CLlanfairpwllgwyngyll%7CBrown_bear%7CQueens%7CNew_York_City%7CPolar_bear&redirects=true&inprop=url&piprop=thumbnail&pilicense=any&pithumbsize=200&pilimit=10&formatversion=2 (possibly many if the reading list has a lot of pages)
    1. NOTE: there is an API call for each Wikipedia that has pages included in the reading list

Can we combine this all into one API call, maybe add a param to the readinglistentries api call to include the metadata with that request? or user the api as a generator? or otherwise add some optimizations to how the API calls are done?

Event Timeline

I think the main challenge here is the fact that reading lists have items on different projects (so meta data is not centrally available).

Instead of a generator, I would advise adding the meta data directly to the API, preferably via an optional opt-in parameter to keep things backwards compatible.

e.g. http://enwiki.mediawiki.mwdd.localhost:8080/w/api.php?action=query&format=json&list=readinglistentries&rlelists=4&rlesort=updated&rledir=descending&rlelimit=12&formatversion=2&rleprops=description|info|pageimages

Not a blocker for initial experiment launch.

aude renamed this task from Optimize API calls made on Special:ReadingLIsts page to Optimize API calls made on Special:ReadingLists page.Mar 18 2026, 5:28 PM
bwang subscribed.

@aude to update this task into spike ticket

bwang raised the priority of this task from Medium to High.Mar 18 2026, 5:44 PM
aude renamed this task from Optimize API calls made on Special:ReadingLists page to Spike - Optimize API calls made on Special:ReadingLists page.Mar 18 2026, 5:57 PM
aude set the point value for this task to 3.
Volker_E lowered the priority of this task from High to Medium.May 5 2026, 5:51 PM

Change #1287919 had a related patch set uploaded (by Aude; author: Aude):

[mediawiki/extensions/ReadingLists@master] Add proposed ADR: Optimizing API calls for ReadingLists entries

https://gerrit.wikimedia.org/r/1287919

Jdlrobson-WMF added a subscriber: AnneT.

@aude I left some feedback on the gerrit patch! hope it's helpful! @AnneT could you also take a look?

When resolving this make sure we have a ticket for the actual implementation.

AnneT removed AnneT as the assignee of this task.Tue, May 19, 6:49 PM

I may not have time to look at this since I need to handle QA for the account creation CTA experiment, help with the donor badge instrumentation, and work on designing a take home task for a hiring panel between today and tomorrow. Moving this back to ready for sprint

Jdlrobson-WMF moved this task from Ready for sprint to Backlog on the Reader Experience Team board.
Jdlrobson-WMF added a subscriber: Sneha.

I talked to @Sneha about this issue and she recommended that we exclude pages from outside the project on a list for now and worry about this later.
I've opened T426789: Limit reading lists to pages from the current project to capture the proposal.

Thanks @Jdlrobson-WMF just want to add that this recommendation is based on the assumption that not many people will be saving items cross wiki. And so if this helps with technical debt we can worry about it later if it becomes a real user need in the future.