-
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 query not invalidating hash #26135
Comments
Excellent issue @herecydev We were just discussing this internally last night and I was about to update the documentation and create an issue. You beat me to it, haha. I'll update the documentation. I think this needs a two part solution:
|
I think this needs to be broadcast well; I would expect a lot of people have that cache rule in place. It's the sort of thing you wouldn't bother checking periodically as well.
Seems sensible, and would "just work" for everyone who's setup blanket rules |
Just got bitten by this :). We enabled a new locale in Contentful but since the static queries didn't change the resulting json files remained in the browser disk cache and were used instead of fetching updated ones. We're seeing a few issues and caching anomalies because of this such as menu items popping in and out. |
Fix published in |
When did this. become an issue? Was it a result of a recent update? Because I had no issue with the static hashes until just recently |
@ibraheemdev 17 days ago, from this pull request: #25723 |
Guys, thank you so much for fixing this issue. I just wish we had found it earlier in the docs or something we have been clueless for months and tried all sort of things until we looked closely at the .json from the static queries and searched for this |
Looking at the guidance on caching (https://www.gatsbyjs.org/docs/caching/#static-files) I think the recent changes to static queries isn't correct with this. @sidharthachatterjee I don't know if this is something you can answer?
The guidance is:
However the .json files that are output to the
static/d
folder look like a hash of the query (schema?) and not of the query result. Images are requested like/icons/icon-512x512.png?v=6097298229b47b2e2010b1492c6fee40
, where the v seems to be a hash of something that rotates when an image has changed.Is this
?v=
supposed to be applied to the static/d/.json files as well?Steps to recreate
gatsby build
static/d/
foldergatsby build
static/d/
folder, it hasn't changedThe text was updated successfully, but these errors were encountered: