Static query not invalidating hash
See original GitHub issueLooking 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:
All files in static/ should be cached forever
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/<hash>.json files as well?
Steps to recreate
- Create gatsby-starter-default
gatsby build
- Observe
static/d/
folder - Change siteMetadata title, for example
gatsby build
- Observe
static/d/
folder, it hasn’t changed
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:7 (5 by maintainers)
Top Results From Across the Web
Bust That Cache Through A Content Hash - Alain Schlesser
No query strings, only a static URL. Cache is only busted if this is actually needed. To meet the first requirement, we put...
Read more >Error when preparing a multiple insert query - Stack Overflow
INSERT INTO DATABASE $sql = "INSERT INTO hashes (hash) VALUES " . implode(', ... SQLSTATE[HY093]: Invalid parameter number: parameter was not defined.
Read more >Managing Hash Clusters - Oracle Help Center
Hashing is useful when most queries are equality queries on the cluster key and the tables in the hash cluster are primarily static...
Read more >Guide for Caching and HTTP Cache Headers for Static Content
Without a CDN, the request for the logo would go from the user's browser to the server before it gets cached on the...
Read more >Adding Hashes to Filenames - SurviveJS
It doesn't allow to leverage client level cache efficiently as there's no way tell whether or not a file has changed. Cache invalidation...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Fix published in
gatsby@2.24.33
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