Cache Spoonie's public pages without caching private reader state
Spoonie does not need to render the same public recipe or topic page from scratch for every visitor. But making a page cacheable brings a second responsibility: account-specific state must stay private, and a change from public to private must not leave an old copy available longer than necessary. Five changes merged on December 3, 2026 addressed that boundary, from PR #57 through PR #61.
Where anonymous visits still needed server rendering
The December 3 baseline showed that public topic pages, creator information, and brand information returned private, no-store responses even to anonymous visitors. Topic rendering depended on request search parameters; partner landing pages also performed server-side account checks.
PR #57 separated the first public topic data and metadata from query-specific interactions. Changing ?tab=post or ?page=2 now uses the existing public data path in the browser instead of requiring another Next.js server-component navigation. The partner information pages serve public HTML while account-specific onboarding state stays behind the existing session-aware path. The public routes remain in place.
PR #58 addressed four more anonymous entry routes: /login, /signup, /forgot-password, and /reset-password. Each now has a static public entry shell. Existing client-side session handling still decides safe return destinations and signed-in redirects. Private account data is not put into the shared public markup.
A longer cache interval was the wrong final answer
PR #59 initially raised the public Recipe and Topic incremental regeneration interval from 600 to 1,800 seconds. That could reduce how often an unchanged page is regenerated, but also made the freshness fallback longer if an edit did not invalidate the page correctly.
PR #60 restored 600 seconds for both routes. I checked the current source: src/app/recipes/[id]/page.tsx and src/app/topics/[tag]/page.tsx both declare revalidate = 600. That is the retained implementation, not the intermediate 1,800-second experiment.
The same PR removed speculative hover/focus React Server Component prefetching from the shared IntentLink. This supersedes one part of my November 19 navigation write-up: the hover-preload behaviour recorded there was accurate for PRs #48–49, but the current shared link uses prefetch={false}. Normal link navigation and keyboard access remain part of the regression checks.
An author edit must still have a path to clear an old public page
Another optimisation in PR #60 skipped invalidation for private-only edits and deletes. It exposed a risk: if an earlier public-to-private update failed to clear a cached public page, a later private edit would no longer try again.
PR #61 restored that invalidation opportunity on author save/delete paths. The shared helper makes one additional attempt for a network failure, HTTP 429, or a 5xx response. It does not retry a 4xx authentication or validation rejection, and it reports a persistent failure without turning a successful database save into a false save error. This improves the recovery path; it is not a guarantee that every cached copy disappears immediately.
What I verified
All five PRs are merged in the original Spoonie repository, with passing GitHub checks and Netlify Deploy Previews. PR #61 passed 471 Vitest tests and six additional unused-image safety checks. On December 3, read-only HTTP requests to public topic, partner, and login routes returned HTTP 200 with public cache headers. Anonymous Chrome checks at 390px and 1440px loaded those pages without JavaScript errors or horizontal overflow.
The change in billable Netlify Functions calls is not measured. A response cache header does not establish the number of server executions. I also did not perform a signed-in production publish, edit, delete, or privacy change. The evidence covers the merged implementation, its tests, and the public read-only behaviour.
Original changes and related reading
- PR #57: public topic and partner cache boundaries · merge commit
- PR #58: cacheable public auth-entry shells · merge commit
- PR #59: the ISR interval experiment · merge commit
- PR #60: restored interval and removed speculative prefetch · merge commit
- PR #61: retry transient invalidation failures · merge commit
- Spoonie project case study · The earlier navigation change · Readable recipe quantities