I recently update a icon I'm using for our company's site and while the plugin worked flawlessly, thanks to http caching, it appeared the updated icon wasn't making it to production. I realized in the end that this was not a browser cache issue but our website host was caching the old icon. Once I realized this I went into the admin panel and reset the cache and everything was good.
This made me think, if we create a hash of the source image and include it in the generated icon name, if it ever changes, the new icons are distributed and old icons are not stuck in browsers.
https://realfavicongenerator.net/ gave me the idea and has this option when generating icons.
We could put this behind a config incase people are referencing generated icons from outside gatsby.
Any suggestions or potential issues around this feature?
I think we could just use the same idea as the https://realfavicongenerator.net/. We could just add a 'version' option which can be defined ingatsby-plugin-manifest. For example:
{
resolve: `gatsby-plugin-manifest`,
options: {
...
version: '20190130',
},
Then we can just reference the version number when generating the HTML.
I'll submit a PR later today which does this 馃憤
You can work on this PR and bring it over the finish line 馃憤
https://github.com/gatsbyjs/gatsby/pull/8343
@lekoarts Good call!! @jordanoverbye not bad idea, just a little more manual. Thanks for your enthusiasm and input on this!
Most helpful comment
You can work on this PR and bring it over the finish line 馃憤
https://github.com/gatsbyjs/gatsby/pull/8343