Page MenuHomePhabricator

Allow values other than ParserOutput to be stored in a ParserCache instance
Open, MediumPublic

Description

Sometime, we have a need to store information other than ParserOutput in association with page output. So far, the preferred way of doing this is to store this data inside the ParserOutput (as a page property or as extension data). While this works well for many cases, there may be situations where this is undesirable:

  • The information is big, and not always needed along with the normal ParserOutput, causing unnecessary overhead (e.g. TemplateData, see T266200).
  • The information is not immediately available after rendering, but may be generated by a background job (e.g. Wikibase constraint reports, see T214362)
  • The information may change under conditions that would not cause the ParserOutput to be regenerated
  • The desired guarantees for availability of the cached content are different from the requirements for the primary content (e.g. quicker expiry to preserve storage space, or local in-memory storage to improve speed)

Since the introduction of ParserCacheFactory, we can easily create separate parser cache instances, and configure them differently according to the needs of a certain kind of output. However, the code still requires all cached output to use the ParserOutput class. That is the last remaining obstacle that keeps us from using ParserCache in a more flexible way.

Event Timeline

Change 651546 had a related patch set uploaded (by Daniel Kinzler; owner: Daniel Kinzler):
[mediawiki/core@master] WIP: Generalize ParserCache

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

@daniel: Removing task assignee as this open task has been assigned for more than two years - See the email sent to task assignee on Feburary 22nd, 2023.
Please assign this task to yourself again if you still realistically [plan to] work on this task - it would be welcome! :)
If this task has been resolved in the meantime, or should not be worked on by anybody ("declined"), please update its task status via "Add Action… 🡒 Change Status".
Also see https://www.mediawiki.org/wiki/Bug_management/Assignee_cleanup for tips how to best manage your individual work in Phabricator. Thanks!