Rendering

Cache generation guard

Application model: a fill records the generation before reading the origin and can publish only if that generation remains current. Compare and write must be atomic in a distributed implementation. Equality alone does not implement a cache handler. The example is a pure predicate, not a distributed cache. Source: https://nextjs.org/docs/app/api-reference/config/next-config-js/cacheHandlers. Documentation-reviewed illustrative draft; installed declarations and runtime not verified.

Formal Syntax & Structure

nextjs syntaxnextjs
startGeneration === currentGeneration

Working Example

Example Snippetnextjs
function acceptFill(startGeneration: number, currentGeneration: number) { return startGeneration === currentGeneration;}console.log(acceptFill(4,4), acceptFill(4,5));
Next.js Reference