jargon

Comparison

Query keyvsRevalidation

Query key

two screens asking for the same data shared one request because they named it the same way.

The identifier under which a cached request is stored, usually including every parameter the request depends on. It is what makes deduplication, revalidation and targeted invalidation possible without a manual cache. Getting it wrong in either direction hurts: a key missing a parameter serves one user's data to another, and a key including something volatile refetches on every render.

Full entry →

Revalidation

the cached data renders instantly and a background request quietly replaces it a moment later.

Serving cached data immediately while fetching a fresh copy behind it, then swapping in the result. It is what makes a data-fetching library feel instant on a second visit, and it is triggered by window focus, reconnect or an interval as well as by navigation. The cost is that users can act on data that is a few seconds old, so anything with a correctness requirement needs an explicit freshness check before the mutation.

Full entry →

Related comparisons