- Notifications
You must be signed in to change notification settings - Fork483
automatically cache busting the json files based on the hash in meta tag#1648
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
atflick commentedAug 19, 2022
Solves this issue:#1032 |
ai-slave commentedOct 31, 2022
@hjvedvik can you please merge this one? |
atflick commentedDec 16, 2022
bumping this again@hjvedvik This would greatly increase the confidence I have when deploying new changes to our public site. We recently had a situation where there were a bunch of updates made to our site that got deployed earlier than we wanted and we rolled them back quickly but the json files were getting cached on the client side which was completely breaking the site for any users who had visited the newly updated version, then the rolled back version. Similar situation happens on consecutive quick changes/updates |
atflick commentedJun 29, 2023
@hjvedvik bumping this again, this simple change would help anyone still using gridsome out A LOT. |
sergeyfilimonov commentedAug 28, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@atflick how is this code working? there is no |
atflick commentedAug 29, 2023
@sergeyfilimonov That works too, but the |

Uh oh!
There was an error while loading.Please reload this page.
Problem: json files get cached and when they are fetched their hash doesn't match the hash that gridsome generated in the HTML that's fetching the json files. This results in the
Hash did not matcherror which then breaks all pages until the user clears their cache.This change simply adds the matching hash as a query param when the json files are fetched, meaning they can still be cached until that hash changes in which they should be freshly fetched.
This is the hash being added in the network tab:
