Page MenuHomePhabricator

Document semantics of caching mediawiki API responses within the context of a parse request / page
Open, MediumPublic

Description

As part of the batching code, Mediawiki API responses are being cached on a per-request basis. This assumes that the API responses are pure functions / stateless. In the general case, that is not true. For example, there could be a time parser function that is used multiple times on the page, or a template that invokes a random number and is used multiple times on the page. So, it seems that caching is not safe. However, Tim clarified that in the PHP parser, lots of things are cached on a per-page level. But, there are exceptions, and then there is the volatile keyword.

It would be good to adequately document this caching behavior which helps us reason about correctness across implementations and also reference it when making changes.

Event Timeline

ssastry created this task.Aug 25 2015, 8:53 PM
ssastry assigned this task to tstarling.
ssastry raised the priority of this task from to Medium.
ssastry updated the task description. (Show Details)
ssastry added projects: Parsoid, MediaWiki-Parser.
ssastry added a subscriber: ssastry.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptAug 25 2015, 8:53 PM
ssastry renamed this task from Document semantics of caching mediawiki API responses within the context of single parse request / page to Document semantics of caching mediawiki API responses within the context of a parse request / page.Aug 25 2015, 8:53 PM
ssastry set Security to None.
Aklapper removed tstarling as the assignee of this task.Jun 19 2020, 4:24 PM
Aklapper added a subscriber: tstarling.

This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!

For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)