Next.js Discord

Discord Forum

Caching dictionaries

Unanswered
Siamese Crocodile posted this in #help-forum
Open in Discord
Siamese CrocodileOP
Hi. I am implementing translations in my nextjs app but all my pages are dynamic. I don't want to refetch translations on every request so I am planning to use unstable_cache that never expires.

I am using this library https://next-international.vercel.app/ but inside it uses cookies to store current locale which I guess breaks my plan because I can't cache this function. Idk if its even optimal to keep it if we will be downloading translations every page request.

I could move to a non library way of doing translations like in nextjs docs but how to use translations inside client components? I dont like passing dict down as props.

0 Replies