Repository navigation
fix(server): send Cache-Control: private, no-store by default - #312
Open
ngunyimacharia wants to merge 1 commit into
Open
ngunyimacharia wants to merge 1 commit into
ngunyimacharia wants to merge 1 commit into
Conversation
API, MCP, OAuth and app-shell responses carried no Cache-Control header. A shared cache in front of the server may then store them: Laravel Cloud's edge, for example, caches a 200 response without Cache-Control for two hours. These responses depend on who is signed in, so a stored copy can reach another caller, and a cached /v1/me keeps the app signed in after sign-out. Mark every response "private, no-store" unless its handler sets its own policy, as document pages do. Fingerprinted /assets/ files keep their caching.
ngunyimacharia
requested review from
anuragrao04 and
razvi-razorpay
as code owners
November 26, 2026 20:49
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.
What and why
API, MCP, OAuth and app-shell responses carry no
Cache-Controlheader, so a shared cache in front of the server (a CDN or a hosting platform's edge) may store them. They depend on who is signed in, so a stored copy can reach another caller, and a cached/v1/mekeeps the app signed in after sign-out.A middleware now marks every response
private, no-storeunless its handler sets its own policy, as document pages do. Fingerprinted/assets/files keep their caching.Closes #307
How it was tested
private, no-store), a document page (keepsprivate, no-cache) and a fingerprinted asset (no header).go test ./api/... ./cli/... ./internal/...andmake lintpass.Checklist
make lintandmake testpass locally