Attempt to add a query cache to DPL

Authored by Bawolff on Sep 10 2020, 6:37 AM.


Attempt to add a query cache to DPL

DPL has some expensive queries. When an expensive query is used
in a template used on a lot of pages, and they all get refreshed
at once (or in this specific case, a bot edited 100,000 such pages
in very short time frame), this can cause a bit of a stampede to
the db to recalculate the same value over and over again, potentially
causing query pile ups.

This adds support for having a cache of the query results. The idea
being that a short cache should help reduce repetitive load on the db.
Using "lowTTL" should help ensure that not all application servers
attempt to requery the DPL at the same time.

By default this cache is disabled, I would suggest setting
$wgDLPQueryCacheTime to be 120 on Wikimedia wikis to begin with,
and see how that works.

Bug: T262391
Bug: T262240
Bug: T263220
Change-Id: I92197f93d67342f9c4e7550ed5760f512d2416b9
(cherry picked from commit 1ce83f59133723d0580ff68091cb719f5fd1fdbc)