#Next.js caching and revalidating problem

18 messages ยท Page 1 of 1 (latest)

clear hullBOT
#

๐Ÿ”Ž This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

๐Ÿ•ต๏ธ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

โœ… You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

cyan gull
#

Using cookies() will mark the entire route into dynamic rendering and i dont think there is a workaround that. IG it might be due to the fact that cookies are returned with the request for the page itself.

heady crag
#

but then what the hell should i do ๐Ÿ˜…

#

any other ways recommended instead of using cookies?

#

to save the auth token?

#

Because that way i cant cache.

#

From that comes, I cant revalidate data

#

and thats making my app worse

cyan gull
#

I dont know why i have never pondered over this but i would assume (and maybe someone else can correct me) but the best way would be to either use a context provider to pass the session around OR use a server action/route handler to fetch the session for you.

heady crag
#

if i use cookies when fetching

#

context could be great

heady crag
#

vercel AI

#

i dont understand the middleware express-session part

minor creek
heady crag