## 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.
TODO: @Halfak @kaldari: Add your use cases
## Requirements
- 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.
Advantages:
- 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.
Disadvantages:
- Need to add an additional id attribute, increasing HTML size.
- Cost of calculating hashes.
Questions:
- Do we need to continue supporting current numbered reference links long term?