Skip to content

Locale cookie may not be updated (Vercel) #936

Answered by amannn
rodrigovcortezi asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @rodrigovcortezi, thanks for the great question!

I've noticed a similar issue when the cache from the client-side router is used and have addressed this in #790. The result is that now every time a navigation API from next-intl is used to switch the locale, the cookie value is kept in sync, regardless of whether the middleware is hit or not.

But back to your issue: Vercel can return a 304 response for cached routes. However, a 304 status code (that lacks the set-cookie response header) can only be issued if the user has visited this very route in the browser previously and the browser sends an If-None-Match request header along with the request.

This means that if the user starts on /de

Replies: 1 comment 2 replies

Comment options

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

@amannn
Comment options

Answer selected by rodrigovcortezi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants