From f61c90a3265eacf22a9cbbcdc61956e30537a462 Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Fri, 6 Nov 2026 10:12:13 +0100 Subject: [PATCH] docs: the site's purge token is NUXT_CACHE_PURGE_TOKEN The layers renamed it from NUXT_SITE_CACHE_PURGE_TOKEN, which nuxt-site-config published in every page's payload. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7a6cbdc..a97f495 100644 --- a/README.md +++ b/README.md @@ -401,7 +401,7 @@ The request is a `POST` to the URL with `Authorization: Bearer `, `Conten - **Timing.** The purge is registered with `lagoon.AfterCommit` on the admin save transaction: it runs only after the save commits, and never for a save that fails, so a concurrent page view cannot re-cache the old content. It runs before the save response, so the cache is clear when the administrator sees the save confirmed. The token API writes purge outside their transaction: the purge is queued once the write committed and sent in the background, so the response does not wait for the site. - **Never fails a save.** The request has a 2 s timeout and ignores the cancellation of the admin request. A refused, failing, slow or unreachable purge is logged as a warning (`cooler: site cache purge failed`) and the save response is unchanged; a successful one logs `cooler: site cache purged` with the kind, slug, status and purged count. The token and the Authorization header are never logged. - **What purges.** Admin creates, updates and deletes of posts and categories, including a save that changes nothing, and the Journal API post writes (create, update, delete, featured image upload and removal). Tags and the posts import action do not purge. -- **Receiver.** The host's Nuxt app built on vue-journal-layer 0.4.0 or later provides the shared route `POST /api/__site__/cache/purge` with its token in `NUXT_SITE_CACHE_PURGE_TOKEN`; the old route `POST /api/__journal__/cache/purge` with `NUXT_JOURNAL_CACHE_PURGE_TOKEN` stays for one release. Generate one token on the server and put the same value in both environments. +- **Receiver.** The host's Nuxt app built on vue-journal-layer 0.4.0 or later provides the shared route `POST /api/__site__/cache/purge` with its token in `NUXT_CACHE_PURGE_TOKEN` (vue-journal-layer 0.6.0 or later; earlier layers read `NUXT_SITE_CACHE_PURGE_TOKEN`, which nuxt-site-config publishes in every page's payload); the old route `POST /api/__journal__/cache/purge` with `NUXT_JOURNAL_CACHE_PURGE_TOKEN` stays for one release. Generate one token on the server and put the same value in both environments. ### Headings and links