Cache the stats object in Redis between updates
inteGraality has never been particularly fast,
but this is understandable because it does a lot
(a NxM SPARQL queries [with N=#groupings and M=#properties]).
The queries (aka looking glass) feature, however, does comparatively
very little: using Pywikibot to read the find the wikipage, read the
config from the template, generate hyperlinks to two SPARQL queries, done.
Yet, it can be excruciatingly slow. The reason for it is that the page
read are heavily throttled by the MediaWiki API every time the Query Service
is lagging behind (which is pretty much all the time these days).
Here, the parameters of the stats object are stored in Redis
when they’re created, and used if already there.
The cache is invalidated when an update of the page is triggered.
Bug: T245210