Page MenuHomePhabricator

Add caching to info action
Closed, ResolvedPublic

Description

Although roughly the queries look fine, it'd probably be worth adding some caching to it...


Version: 1.20.x
Severity: enhancement

Details

Reference
bz39490

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:58 AM
bzimport set Reference to bz39490.

So I'm not sure how to go about the whole unwatched pages caching issue. Maybe just cache the database queries rather than the actual rendered list? If anybody has any suggestions that'd be great.

I would suggest caching it but only showing it if the user fits the criteria.

I agree, but the problem is that by the time the data is retrieved from the database and is processed, it's in a numerically indexed array. So what I'm saying is that there are two options: 1) Go through linearly and remove the information when we find it; or 2) instead of caching the actual processed array (which includes messages and whatnot), only cache the database queries. The problem with both solutions is that they're cause inefficiency.

madman.enwiki wrote:

The latter is what I'd do, caching the results of pageCounts rather than pageInfo, containing the (very relatively) expensive queries Reedy was talking about in opening this bug.

Mhm, that's what I am thinking as well. I should be able to make a patch for this relatively easily.

The info action will ultimately include information such as number of transclusions or number of file uses. My concern is that updates (such as a new transclusion) won't propagate to these cached counts and users will end up seeing bad data.

(In reply to comment #7)

The info action will ultimately include information such as number of
transclusions or number of file uses. My concern is that updates (such as a new
transclusion) won't propagate to these cached counts and users will end up
seeing bad data.

Which is the same as most cached data in MediaWiki...

True, but in that case, in the patch that introduces that information to the page, just put something that invalidates the InfoAction cache for every time a new templatelink is added.

(In reply to comment #1)

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

Approved by Chris on the 18th.