Page MenuHomePhabricator

Add image: Support loading recommendation data from cache
Closed, ResolvedPublic

Description

The service image recommendation provider can take enough time to fetch data that it impacts the user experience. And it will take longer once metadata fetching is also included in the request (T290782).

Fetching from WANObject cache is much faster and removes a significant chunk of overhead from the response time. See for example this request
https://w.wiki/4LJb and how the HTTP request takes 430ms, 31% of the wall time)

The proposal is to swap in a cache-backed recommendation provider for the existing HTTP provider; check the cache, and if nothing's found, call the uncached
service image recommendation provider

To populate the cache, when we fetch TaskSet objects (on Special:Homepage), we can kick off deferred updates to fetch and cache image recommendation data for any image recommendation task types in the TaskSet.
When the user clicks through to a task, we should be able to load data from the cache instead of via HTTP
request to the service.

Event Timeline

Change 736747 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/GrowthExperiments@master] Use cached image recommendations

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

kostajh triaged this task as Medium priority.Nov 5 2021, 9:04 PM

Change 736747 merged by jenkins-bot:

[mediawiki/extensions/GrowthExperiments@master] Use cached image recommendations

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

Tgr added subscribers: Etonkovidova, Tgr.

@Etonkovidova we have a short-lived (5 min) cache layer now for recommendation data. This task is probably not directly QA-able, just FYI.

@Etonkovidova we have a short-lived (5 min) cache layer now for recommendation data. This task is probably not directly QA-able, just FYI.

I was checking/monitoring from the point of user experience - no issues were noticed.