Page MenuHomePhabricator

Parsoid: Maintain context for selser on the server side
Closed, ResolvedPublic

Description

Selective serialization (aka selser) of HTML to wikitext requires the base rendering (HTML and data-parsoid mapping) for context. Having the client load and then send back this context is expensive. This can be avoided by teporarily stashing the context on the server side when the client loads HTML for editing.

There are three cases we want to support:

  1. Explicit: when the client sends the modified HTML, it also sends a key (etag) of the base rendering, and the base rendering is found in the stash (T310464)
  2. Opportunistic: when the client sends a key (etag) of the base rendering, but it is not found in the stash. However, there HTML in the ParserCache, and it happens to still be the correct rendering. (T318395)
  3. Best effort: The client does not send a render key. In this case, we try to use the lateste rendering of the page (or the revision specified by the client) as context for selser. That rendering can come from the ParserCache or be generated by re-parsing the page (T318398).

We should also collect metrics on how often each of these cases happen, and how often none of them applies and we can't use selser. Note that page creation needs to be counted separately.

Event Timeline