-
-
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
Respect cache options in subsequent_fetch #7971
Comments
I don't fully understand the issue. To clarify: In your reproduction, you set the cache control header inside |
Thanks for que quick answer!! I've updated the Reproduction section to better explain my issue |
Thanks, I understood the problem now. |
Just saw your PR and it's exactly what I meant. Thanks a lot! |
* [fix] respect fetch cache option fixes #7971 * fix cache key computation
Describe the bug
Found two bugs in cache implementation at client-side fetcher.js:
delete
andget
are using different keysAbout the cache option (RequestCache from RequestInit), I think it should redo the request if it's set to 'no-store', 'no-cache' or 'reload'.
Another option is to let the browser handle the cache entirely, but I assume there's a reason to be a cache object (and that's why I didn't create a PR).
Reproduction
I've created a very simple example to explain the issue that I have in my private app. To better explain the issue here a few facts of my application (which should be a very common case):
Here the problem arises: If max-age is set, the user data is not being reloaded by invalidateAll even if I set
{ cache: 'reload' }
in fetch options.Example
The example bellow does 3 things to demonstrate this:
cache: 'reload'
, to show that the response is different from what's on the screen (thus returned by +page.js)Submitting the form with a different name does not update the page data. By navigating back and forward and looking at the console you can see that the invalidateAll function does not take effect (because the resource is cached), even after reloading the HTTP cache.
Reloading the page does update the data.
Logs
No response
System Info
Severity
serious, but I can work around it
Additional Information
No response
The text was updated successfully, but these errors were encountered: