Page MenuHomePhabricator

[SPIKE] Which API requests should be cached and for how long?
Closed, DeclinedPublic

Description

In API requests we can specify a cache time for queries that are unlikely to change.
You can do this by adding parameters to the API request.

Define in seconds
maxage (tells client to cache for a period in seconds)
smaxage (tells varnish to cache for a period in seconds)

Acceptance Criteria

  • Review all the uses of the API in Reading's extensions and determine if any would benefit from this
  • Create a Phabricator task to track doing suggested changes
  • Notify iOS and Android teams of any results as they should also benefit

Event Timeline

Jdlrobson raised the priority of this task from to Needs Triage.
Jdlrobson updated the task description. (Show Details)
Jdlrobson added subscribers: Mholloway, Ricordisamoa, He7d3r and 7 others.
Tgr added a subscriber: Tgr.Jun 29 2015, 9:05 PM

See also T97096.

jeremyb added a subscriber: Pharos.Aug 11 2015, 9:59 PM
jeremyb added a subscriber: jeremyb.

Is there anything concrete we want to do with this? I quite not understand the description (seems to state an existing feature, but I can't see work to be done).

Help @Jdlrobson?

Dbrant added a subscriber: Dbrant.Aug 14 2015, 1:32 PM
Jhernandez triaged this task as Normal priority.Aug 17 2015, 11:19 AM
Jdlrobson set Security to None.
Jdlrobson renamed this task from API requests should be cached to Spike: API requests should be cached.Jan 11 2016, 9:41 PM
Jdlrobson updated the task description. (Show Details)
Jdlrobson removed a project: Phlogiston-Category.
phuedx renamed this task from Spike: API requests should be cached to [SPIKE] Which API requests should be cached and for how long?.Jan 11 2016, 10:52 PM
phuedx updated the task description. (Show Details)
Mholloway moved this task from Backlog to Tracking on the Mobile-Apps board.Jun 3 2016, 3:02 AM
Jhernandez raised the priority of this task from Normal to High.Jul 27 2016, 4:44 PM
Jhernandez moved this task from Incoming to Triaged but Future on the Readers-Web-Backlog board.

The apis we tend to use in MobileFrotend are logged in only or cannot be cached (eg. edits)
Maybe language and search could benefit.

ovasileva lowered the priority of this task from High to Normal.Feb 6 2017, 8:15 PM
Jdlrobson closed this task as Declined.Apr 17 2017, 10:49 PM

The only extensions that we own that use API are...

MobileFrontend we use mediawiki api for the following:

  • Search
  • References
  • Editing
  • Nearby (NearbyGateway)
  • Watchlist
  • Categories
  • To list a user's uploads (using PhotoListGateway)

I don't think any of these would benefit given they are likely to be hit by the same user infrequently.
Many of the APIs benefit from getting freshest content (for example WatchlistGateway and NearbyGateway). A case could be made that both of these would benefit from using maxage, but I'm not seeing any pressing need to.

Related Articles

  • morelike api (already uses maxage)

Page previews (we're using REST)