Parent
#132
What to build
Make the frontend read the FSE snapshot from a runtime cache instead of from a file baked into the build.
Today the snapshot is a build artifact imported statically, so it is inlined into the compiled server bundle — a template edited in WordPress cannot reach the frontend without a full rebuild and redeploy, and the build itself fails soft (shipping a site with no templates) whenever WordPress is unreachable.
After this ticket the snapshot is fetched on demand and held in Next.js' cache under a cache tag, with a one-hour backstop that matches the page's existing revalidation window. The template lookup becomes asynchronous. The dev and build lifecycle hooks that generated the file are removed, as is the ignore rule for the generated file.
Design decisions are fixed in #132 and should not be relitigated: the caching primitive is the "use cache" directive behind its narrowly-scoped config flag — not app-wide cache components, and not the legacy unstable cache helper.
⚠️ The cached unit must be the finished snapshot, not the underlying HTTP call. The GraphQL client issues POST requests, and Next.js never caches POST fetches. Caching at the wrong level silently re-queries WordPress on every regeneration — roughly a second each time — instead of once per invalidation.
Acceptance criteria
Blocked by
Parent
#132
What to build
Make the frontend read the FSE snapshot from a runtime cache instead of from a file baked into the build.
Today the snapshot is a build artifact imported statically, so it is inlined into the compiled server bundle — a template edited in WordPress cannot reach the frontend without a full rebuild and redeploy, and the build itself fails soft (shipping a site with no templates) whenever WordPress is unreachable.
After this ticket the snapshot is fetched on demand and held in Next.js' cache under a cache tag, with a one-hour backstop that matches the page's existing revalidation window. The template lookup becomes asynchronous. The dev and build lifecycle hooks that generated the file are removed, as is the ignore rule for the generated file.
Design decisions are fixed in #132 and should not be relitigated: the caching primitive is the
"use cache"directive behind its narrowly-scoped config flag — not app-wide cache components, and not the legacy unstable cache helper.Acceptance criteria
Blocked by