-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Static files changed content, but hash is the same (static query) - breaks website caches #26490
Comments
Hey sorry you're hitting this. This was fixed a little while ago in #26242 — could you try upgrading to the latest? |
perfect, thanks. I will try and update. |
So seems to have moved in another folder, but hash is the same. I upgraded to That fix has been pushed on |
For files in that folder, the caching rules is that the browser revalidates on every request like with page query data. So you shouldn't see problems with stale content. |
Ah, so the fix didn't change the hash based on contents... Are you planning to ever convert to hash based on contents? |
I encountered the same problem, I think hash value should be set according to the content of JSON, rather than never change |
Reading here https://www.gatsbyjs.com/docs/caching/#static-files says these files should be cached because never change contents. Well, it did.
I have a feeling is happening because the static query is outside the project directory, in node_modules and the hash is not refreshed or is not based on the contents.
It's very interesting that even if I clean the cache folder, the query is set to the same filename.
Changing the query itself changes the hash
limit: 20
->limit: 21
Description
I have this static query (in a node_module to another project. I got a common project for common gatsby stuff reused between many websites. So this file is not in my main project directly, is in node_modules)
and is built to this file: static/d/3852913098.json
But the contents changed when I added a new post, but the file name is the same.
Steps to reproduce
See file above
Expected result
Create a new file with different hash
Actual result
Same hash
Environment
The text was updated successfully, but these errors were encountered: