## Problem description
The implementation of citations is currently closely tied to skins, and not very optimized for working with citations as structured data. New use cases require more structured access to a) all revision content, and b) individual references.
### Use cases
The mobile web team would like to speed up page load times by lazily loading references only when the user clicks on a reference link.
Specifically: A reference link inside a superscript tag has a unique identifier and this unique identifier can be used to retrieve the HTML for the reference and render it in a reference drawer:
TODO: @Halfak @kaldari: Add your use cases
- For each revision, support efficient retrieval of
- page content without references, and
- all reference blocks.
- For each revision, support retrieval of individual references.
- Ideally, provide stable identifiers of unmodified references across revisions.
## Possible solutions
Goal: Discuss different options, focusing on trade-offs.
### Stable reference IDs
Current reference ids are based on counters, which makes them inherently unstable between revisions or parser implementations (PHP parser vs. Parsoid). It would be useful to instead use //stable reference ids//, based on something like a hash of the reference wikitext.
- Enables tracking of unmodified reference content across revisions.
- Automatic cache busting for per-reference APIs.
- Can simplify reuse of expanded reference content.
- Makes use of Parsoid reference content from PHP-parser views robust.
- Need to add an additional id attribute, increasing HTML size.
- Cost of calculating hashes.
- Do we need to continue supporting current numbered reference links long term?