Hi, I have some questions about the default cache control.
The default en variables indicat that all js files will be cached public and expire 1 year. But gatsby doc suggest sw.js shoud be uncachable:
The only exception to this is the file /sw.js, which needs to be revalidated upon each load to check if a new version of the site is available. This file is generated by gatsby-plugin-offline and other service worker plugins, in order to serve content offline. Its cache-control header should be cache-control: public, max-age=0, must-revalidate1
And the doc also says json files should be uncachable too:
Similar to HTML files, the JSON files in the public/page-data/ directory should never be cached by the browser.
How can I achieve this? I try the following, but didn't work:
- CACHE_IGNORE=html|page-data\.json|sw\.js- CACHE_IGNORE=html|page-data.json|sw.js
If just use json, the json files work, but how to specify sw.js?
- CACHE_IGNORE=html|json|sw.js
Hi, I have some questions about the default cache control.
The default en variables indicat that all js files will be cached public and expire 1 year. But gatsby doc suggest sw.js shoud be uncachable:
And the doc also says json files should be uncachable too:
How can I achieve this? I try the following, but didn't work:
- CACHE_IGNORE=html|page-data\.json|sw\.js
- CACHE_IGNORE=html|page-data.json|sw.js
If just use json, the json files work, but how to specify sw.js?
- CACHE_IGNORE=html|json|sw.js
Thanks!