As a Wikidata or Commons visitor, I want mobile page views to load quickly if possible.
As an SRE, I (presumably – I’m not one) want mobile page views to not do unnecessary work, and to use cached data if available (so as to reduce server load).
Problem:
Mobile page views on WikibaseRepo wikis never use content from the parser cache unless looking at an item or property. When a parser cache entry is loaded, the parser cache runs the onParserCacheSaveComplete hook; Wikibase’s handler in RepoHooks::onRejectParserCacheValue() delegates the decision to the TermboxVersionParserCacheValueRejector; the rejector determines that the current page view should render a termbox (according to TermboxFlag::shouldRenderTermbox()), yet there’s no termbox version in the parser options, therefore the parser output should be rejected. This happens on every mobile lexeme page view, every mobile wikitext page view, every mobile file page view, etc. – only item and property pages use the parser cache (because they actually have a termbox).
Note that this only applies when the entry is loaded from the parser cache. Afterwards, we still save an entry to the parser cache; the fact that, for lexemes, this entry is then used for future desktop page views (where the rejection hook handler doesn’t apply, because desktop page views aren’t expected to have a termbox!) is what causes T344362: Some Lexemes seem to miss styles/scripts. Can be "fixed" by purging.. We’re fixing T344362 separately by splitting the parser cache, but that will still leave the issue of many mobile page views being inefficient due to not using their own cache results.
Example:
Load mobile L123 a few times and look at the “Saved in parser cache” comment in the HTML source; you will see a different timestamp each time. (You’ll need to be logged in for this, or use WikimediaDebug, to bypass the HTTP-level cache – that cache is still working. Likewise, you might need Ctrl+F5 instead of just F5.) Repeat for mobile Wikidata main page, sandbox talk page, or Commons main page.
You can use this JS snippet in the console to quickly see the parser cache comment (should work on desktop and mobile):
document.getElementById('mw-content-text').innerHTML.match(/<!-- Saved in parser cache.*$/m)[0]
Screenshots/mockups:
BDD
GIVEN
AND
WHEN
AND
THEN
AND
Acceptance criteria:
- WikibaseLexeme mobile page views use the parser cache as much as possible
- Wikitext mobile page views use the parser cache as much as possible
Open questions:
