Skip to main content

Module changes

Module changes 

Source
Expand description

GET /api/v2/changes/ — has anything moved?

?updated_since= lets a client fetch only what changed in one collection, but it still has to ask every collection to find out whether any of them did. A dynamic frontend polling pages, images, documents, snippets and menus pays five full list responses per tick to discover, almost always, that nothing happened.

This is the cheap tick: one small response saying, per collection, how many rows the caller can see and when one of them last changed. A client keeps the previous answer and re-fetches only the collections whose entry moved — with ?updated_since= set to the latest it already held.

§Why count and not just latest

A deletion moves no timestamp. Without the count, a client that had cached a page would keep serving it forever after an editor removed it, because latest never advanced. The pair — “how many, and how recent” — catches additions, edits and removals between them.

It is not a push feed and does not pretend to be: there is no SSE or WebSocket here, and a client still decides its own cadence. What it removes is the cost of asking.

§Cost

Viewer-aware, and therefore not free. The counts must reflect what this caller may see, or the endpoint would report that a member-only page exists to someone who cannot read it — so it runs the same visibility filters the list endpoints do. Roughly the cost of one list request, replacing five.

Functions§

changes
GET /api/v2/changes/
changes_inner