Comparison
Dirty statevsRevalidation
Dirty state
you track whether the form has been touched so you can warn before the user navigates away.
A flag recording that local edits have not yet been persisted. It drives the unsaved-changes prompt, the enabled state of a save button, and whether a background revalidation is allowed to overwrite what is on screen. That last one is the subtle part: a refetch that clobbers a half-written form is a data-loss bug, not a caching detail.
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 →