salomon_.
Server side fetch refetches on client 3 times
I call
useFetch()
in 3 components and when I do switch locale it refetches 3 times on client. Why? Shouldn't it cached after 1st call?
I followed recipe on nuxt docs so I got:
Custom fetch
Composable
API method
7 replies
How to manage 'remote' localization
Hello,
In my nuxt 3 app I get content in specified locale (using header) from CMS. So almost every component needs that data. What's the best way to manage it?
Fetch that data on server and store in pinia?
Or nuxt has an built in api to get cached data and I can use it?
Can i18n module helps in my scenario?
5 replies
Correct way to get cookie from the rest api
Hello, I am wondering what's the correct place to get
csrftoken
from backend rest api and send to the user? I use ssr, so I want to make it on server side. So in my attempt I created server/api/csrftoken.ts
where I get the token from backend, then created server/middleware/auth.ts
with the following content:
But it doesn't work, I got 500 error from the Nitro. Maybe there is a correct way?17 replies