Revalidate the site layout when a global is saved

buildGlobalRevalidateHook + ipalKit({ revalidatePath }) wires it into the
plugin's globals; menus, consent texts and analytics IDs no longer stay
stale for the whole ISR window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Radosław Smoliński
2026-10-22 17:09:00 +02:00
co-authored by Claude Opus 5.5
parent 7c05a1dba9
commit 7967453f57
7 changed files with 98 additions and 5 deletions
+10
View File
@@ -12,6 +12,7 @@ export type TotpPluginFactory = (options: {
forceSetup: boolean
totp: { issuer: string }
}) => Plugin
import type { RevalidatePathFn } from './modules/hooks/buildRevalidateHook.js'
import type { AccessOption } from './modules/access/types.js'
import type { ContentOption } from './modules/content/types.js'
import type { FormsOption } from './modules/forms/types.js'
@@ -88,6 +89,15 @@ export type IpalOptions = {
*/
pages?: PagesOption
/**
* next/cache `revalidatePath`, INJECTED (the plugin never imports next/cache).
* When given, saving any of the plugin's globals (Site Settings, Site
* Integrations, Cookie Settings, Notifications) revalidates the whole site
* layout, so logo, menu, consent texts and analytics IDs change at once
* instead of after the ISR window. See buildGlobalRevalidateHook.
*/
revalidatePath?: RevalidatePathFn
/**
* SEO — adds meta fields to chosen collections (via @payloadcms/plugin-seo)
* and enables locale-aware metadata helpers.