Page MenuHomePhabricator

Build selective update functionality in Parsoid to efficiently support structured fragment generators
Open, Needs TriagePublic

Description

It is useful to view a wiki page as a composition of content fragments where we have content generators like templates, extensions, and parser functions injecting content fragments onto the page. Wikifunctions is yet another fragment generator entering the picture. Whenever the output of a fragment changes (ex: a template is edited, wikifunction code is updated), there is no reason to regenerate the content of the entire page from scratch. It is more efficient to use the existing output and selectively update the fragment in-place. This is harder to implement for templates today in the general case since output of templates is not guaranteed to be a well-structured fragment. But, there is a lot of benefit to such a solution, specifically for wikifunctions.

T363421: Prototype selective HTML updates in Parsoid is the first step in this process.

Event Timeline

Note that Charts is interested in being a test case here, as we could benefit from a secondary caching layer for renderings of {Charts} SVG data. These have dependencies on pages on Commons (Data: pages with the chart data and format description, and in future any Lua modules or additional resources used for data transforms).

We currently track these dependencies through the globaljsonlinks table (via JsonConfig) and push page-level cache invalidation updates via the job queue, but we have no intermediate cache for chart renderings that might get run over and over.

This is sounding relevant to our interests. :) I'm avoiding introducing a manually-operated intermediate cache with an eye towards adopting fragment caching with selective updates.