Repository navigation
fix: allow caching for _serverFn requests - #69
Merged
Merged
Conversation
JonasJesus42
force-pushed
the
fix/serverfn-cache-bypass
branch
from
April 7, 2026 22:58
6172e93 to
8596fef
Compare
Remove /_server from DEFAULT_BYPASS_PATHS and detectCacheProfile "none" pattern. Server function responses (/_server/, /_serverFn/) carry public CMS data (shelves, sections, product lists) that should be cacheable. Private responses are still protected: any response with Set-Cookie is forced to "private, no-cache, no-store" in both the cacheable and non-cacheable flows, preventing session/cart tokens from leaking to other users through cached responses. Co-Authored-By: Claude Opus 4.6 <[email protected]>
JonasJesus42
force-pushed
the
fix/serverfn-cache-bypass
branch
from
April 7, 2026 23:02
8596fef to
38b528f
Compare
|
🎉 This PR is included in version 1.2.10 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
4 tasks
vitoUwu
pushed a commit
to vitoUwu/deco-start
that referenced
this pull request
Jul 21, 2026
…n-migration skill New skill .agents/skills/decocms-v6-to-v7-upgrade/ teaches upgrading a TanStack site from @decocms/[email protected] + @decocms/[email protected] to the split 7.x packages. Distilled from three production migrations: lebiscuit (73daa3b → b5fdf69 → 6d311d8, the canonical commit sequence), miess PR decocms#86, granadobr PR decocms#69. Covers the dep swap (only the apps-* splits a site imports), the complete mechanical old→new import mapping (references/import-mapping.md — setup split into createSiteSetup/createAdminSetup, hooks barrel split, routes/router/ workerEntry to the @decocms/tanstack root), the .deco/ artifact move (invoke.gen.ts stays in src/ — empirically load-bearing), every edge case we hit (useHydrated from @tanstack/react-router, cookiePassthrough public at 7.6+ and the client-bundle-leak trap of the older shims, deferredSectionLoader public at 7.7+, the pre-7.7 --apps-dir and neverDefer workarounds fixed earlier in this branch, granadobr's site-globals generator, double-encoded block filenames self-healing via generate-blocks' parseBlockId-matching single decode), and the six verification gates (clean lockfile, idempotent regeneration, typecheck diff-vs-baseline, build, dev smoke, preview parity diff). .claude/skills/run-migration/SKILL.md rewritten: it described the Fresh→TanStack flow with hardcoded /Users/jonasjesus/... paths and the long-gone repo-root scripts/migrate.ts. It now points at the migrator's real home (packages/blocks-cli/scripts/migrate/, run via tsx from a checkout of this repo or the published deco-migrate bin), stays generic about paths, and cross-links the new v6→v7 skill for already-TanStack sites. The migrator's DETECT patterns that match legacy @decocms/start code in sites are intentionally untouched — they detect old code on purpose, and the skill now says so. Co-Authored-By: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/_serverFn/URLs (CMS section server functions for shelves, deferred sections) were incorrectly matched by the/_serverprefix in bothdetectCacheProfileandDEFAULT_BYPASS_PATHS, forcingCache-Control: private, no-cache, no-store, must-revalidate/_server/(trailing slash) so only TanStack Router internal RPC is bypassed, while/_serverFn/falls through to the default "listing" profile with proper public caching (edge 120s, browser 30s + SWR/SIE)Test plan
_serverFnshelf requests return public Cache-Control headers instead ofprivate, no-cache, no-store, must-revalidate/_server/RPC calls (TanStack Router internal) still bypass cache correctly🤖 Generated with Claude Code
Summary by cubic
Allows public caching for
/_serverand/_serverFnrequests, while protecting private responses with aSet-Cookieguard. This speeds up shelves and deferred sections via CDN/browser caching./_serverfrom the "no cache" detector andDEFAULT_BYPASS_PATHS; defaults now only include/_build,/deco/,/live/,/.decofile./_serverand/_serverFnnow use the standard public caching profile.Set-Cookieis forced to private and bypassed to prevent token leakage.Written for commit 38b528f. Summary will update on new commits.