-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swr
routes throw 404
on consecutive requests + generated html is not cached
#15084
Comments
swr
routes throw 404
on consecutive requests + generated html is not cached (vercel)swr
routes throw 404
on consecutive requests + generated html is not cached
Would you try again with rc12? We released a number of changes to nitro, including some changes to swr caching. |
Sure, updated the repro and live deployment to rc12. The 404 issue seems resolved from what I can tell, still no caching with |
For caching on Vercel, you can set the following route rule: '/**': { cache: { swr: true, maxAge: 120, staleMaxAge: 60, headersOnly: true } }, |
On vercel, the swr cache is working when i refresh the app with F5, but not when i come from an internal nuxtlink where i still see external API calls ? |
@Neuvier You will need to set |
It's working, Thanks so much ! |
Environment
Windows_NT
v16.13.2
3.0.0-rc.11
-
npm@8.13.2
vite
-
-
-
Reproduction
https://github.com/warflash/nuxt_swr
https://nuxt-swr.vercel.app/
Describe the bug
There's probably two distinct bugs here, not 100% sure. Can open another issue if required.
Deploying the above repro to vercel returns
x-vercel-cache: MISS
even after multiple refreshes, eventhough swr is enabled for all routes in the nuxt config. Additionally spam refreshing results in nuxt returning an error pageThis page is temporarily unavailable.
I have not tested this for different deploy targets so might be vercel related
Additional context
No response
Logs
No response
The text was updated successfully, but these errors were encountered: