Skip to content
Discussion options

You must be logged in to vote

Two things nobody's flagged yet.

First — you mentioned you're on Next.js 16. In 16, middleware.ts was renamed to proxy.ts with an exported proxy() function. If you've been editing middleware.ts, that file isn't running, which would explain why the fix above changed nothing. Worth confirming which filename you actually have.

Second — x-middleware-cache: no-cache won't help here. That was an internal for the client router cache, not a CDN header, and CloudFront ignores it.

To confirm what's happening, following on from @icyJoseph's request: hit /login while logged in with devtools open, preserve log, and check the response headers on the /login document request. If you see x-cache: Hit from…

Replies: 6 comments 11 replies

Comment options

You must be logged in to vote
4 replies
@anshul3212
Comment options

@kuldeeprajput-dev
Comment options

@anshul3212
Comment options

@amrishkhan05
Comment options

Comment options

You must be logged in to vote
3 replies
@anshul3212
Comment options

@icyJoseph
Comment options

@anshul3212
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@anshul3212
Comment options

@anshul3212
Comment options

Comment options

You must be logged in to vote
2 replies
@anshul3212
Comment options

@icyJoseph
Comment options

Answer selected by anshul3212
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
7 participants