docs(17-05): todo for a site cache purge on menu and FAQ saves

This commit is contained in:
2026-10-12 18:34:02 +02:00
parent af02e6ce3e
commit 7290d8f47b

View File

@@ -0,0 +1,26 @@
---
created: 2026-10-12T16:40:00.000Z
title: Purge the Nuxt site cache on menu and FAQ admin saves (framework-level purge service)
area: framework
severity: minor
files:
- modules/cabana
- ../sm-journal-plugin
- ../sm-menu-plugin
- ../sm-faq-plugin
- ../sm-sitemap-plugin
---
## Problem
Phase 17 (plan 05) moved a site's menu and homepage FAQ onto the menu and FAQ plugins, rendered by the Nuxt layers `vue-menu-layer` and `vue-faq-layer`. The Nuxt app caches pages with Nitro `swr` (300 s on most routes). A Journal post or category save purges that cache: the Journal plugin posts to the Journal layer's `/api/__journal__/cache/purge` route on loopback with a shared token (Phase 16.x). Menu, menu entry and FAQ saves do not, so an editor's change shows only after the TTL (at most 300 s). RESEARCH Open Question 4 left this open; the site's DEPLOY.md ("Blog companions") documents the delay.
The purge today is Journal-specific: the URL and token live under `golem15.journal.site_cache.*`, and the Nuxt route is the Journal layer's. Copying it into every content plugin would give each its own config keys, token and route.
## Solution
1. A framework-level purge service (for example in `backpack` or a small new module) that any plugin can call after a committed admin save: one configured target (`site_cache.purge_url`, `site_cache.purge_token`), the same loopback POST and bearer token, failures logged and never failing the save.
2. Journal moves onto it, keeping its current keys as aliases for one release.
3. The menu plugin calls it after a menu or menu entry save, reorder or delete; the FAQ plugin after a FAQ save or delete; the sitemap needs none (it is generated per request).
4. The purge route moves out of `vue-journal-layer` into a shared place (a tiny layer, or each layer accepting the same route), so a site without Journal still gets purges.
5. Document the keys in the module README and the site deploy guides.