-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Cache problem with client-side navigation: the response is now __data.js instead of __data.json #6458
Comments
fwiw, I get from |
It's devalue. That's the reason the file-extension has been changed to |
I knew that this caching problem will occur not only in the context of legacy support in #6265!! I had solved this issue by appending the local JS date value to the query, to force the caching to not happen, via: kit/packages/kit/src/runtime/client/client.js Lines 1494 to 1503 in 2fad78d
I think that one possibility for disable caching, is by send some "no-cache" header on the HTTP respond by the kit server, and then Cloudflare or any other CDN will avoid caching this result. |
Describe the bug
I believe the recent change where client-side navigation responds with __data.js instead of __data.json can be problematic.
I have Cloudflare on my site and I just realized that the __data.js files that are returned when navigating between pages are being cached on the edge and possibly also in the browser cache. I don't have any custom page rules for .js files in Cloudflare, this is the default behavior.
In some cases, the "age" in the response headers is showing very high numbers, much higher than what I have in my s-max-age cache-control headers in hooks.js (which used to cache on Vercel edge only, not Cloudflare).
This means that many users are potentially seeing very old and outdated info for pages that are supposed to be highly dynamic.
Reproduction
I don't think I can set up a reproduction since it would require a custom domain and adding it to Cloudflare.
Logs
No response
System Info
Severity
Blocking an upgrade
Additional Information
Update: I rolled back to 446 for now since the 447 update seems to also have introduced a bunch of weird issues with both Sentry and Plausible Analytics.
The text was updated successfully, but these errors were encountered: