A revision is a number that changes whenever the registry changes — an app is added, updated, or removed.
You store that number. Next time, you ask “what changed since mine?”
Example
If your copy is revision 152 and PWARegistry is revision 153, you do not re-download the whole registry. You fetch the changes feed and apply the diff.
Detect a revision change
const meta = await fetch(
"https://pwaregistry.org/registry/v1/meta.json",
).then((r) => r.json());
if (meta.revision === localRevision) {
// nothing to do
}
Fetch only what changed
const changes = await fetch(
`https://pwaregistry.org/registry/v1/changes.json?since=${localRevision}`,
).then((r) => r.json());
// changes.added — new ids
// changes.updated — ids whose record changed
// changes.removed — ids you should drop from active lists
for (const id of [...changes.added, ...changes.updated]) {
const rec = await fetch(
`https://pwaregistry.org/registry/v1/apps/${id}.json`,
).then((r) => r.json());
await save(id, rec);
}
for (const id of changes.removed) await drop(id);
localRevision = changes.revision;
If an id is added and later removed in the same window, it appears only in removed (or not at all if you never stored it).
Convenience: GET /api/v1/changes?since=N returns the same payload.
Per-revision snapshots: GET /registry/v1/revisions/152.json. When 152 is no longer current, that file is cached as immutable.
The recommended architecture for a large project is on Syncing a Large Registry.