Revalidation

Event-driven Next.js cache invalidation triggered by Payload content changes

Community 0 1.5k/wk MIT v0.5.7

Installation

pnpm add @klnap/revalidation

About

Revalidation expires Next.js cache tags and paths when content changes in Payload. You declare each cache tag once and reuse that declaration in cached functions and in the rules that invalidate them, so the strings cannot drift apart and a misspelled tag no longer leaves stale content behind without any error.

Payload collections and globals that opt in send an event after each save, with change detection, locale and draft handling. Changing a shared media file can also refresh the documents that use it. Events travel over an authenticated HTTP request with a bearer secret, and the receiving Next.js route runs the matching revalidation. Other systems can send events too, and invalidation can reach caches beyond Next.js, such as a CDN.

Package info

Package name
@klnap/revalidation
Latest version
0.5.7
Unpacked size
282 kB
License
MIT
Weekly downloads
1.5k
Last publish
Nov 28, 2026

More from klnap

View profile

Identifies Admin users and tracks sign-in flows in PostHog

Slug field that fills itself from another field, with optional Auto/Manual mode

Uses prefixed UUIDv7 TypeIDs as native Payload document IDs per collection

Creates redirect rules automatically when published URLs change

Stores Payload media in Sanity with on-demand image transforms and CDN delivery

Similar plugins

More in Cache

Shared CMS setup for Pebble sites: users and roles, R2 media, signed cache purge and previews

Admin button that refreshes Next.js cache tags for chosen users

Pushes content changes from Payload to open pages without a reload

Managed redirects with cache-backed Next.js middleware and an orderable admin list

Moves frontend translation keys into the Payload database for editors to manage

Revalidates Next.js paths and cache tags when documents are published or deleted