Skip to content

Commit 9280fd7

Browse files
matthieuaugerpieh
authored andcommitted
fix(gatsby-plugin-netlify): do not cache service worker file on Netlify (#9680)
Related to https://www.netlify.com/blog/2018/06/28/5-pro-tips-and-plugins-for-optimizing-your-gatsby---netlify-site/#4-get-your-service-workers-um-working Recommandation is not to cache service worker file : w3c/ServiceWorker#893 <!-- Q. Which branch should I use for my pull request? A. Use `master` branch (probably). Q. Which branch if my change is a bug fix for Gatsby v1? A. In this case, you should use the `v1` branch Q. Which branch if I'm still not sure? A. Use `master` branch. Ask in the PR if you're not sure and a Gatsby maintainer will be happy to help :) Note: We will only accept bug fixes for Gatsby v1. New features should be added to Gatsby v2. Learn more about contributing: https://www.gatsbyjs.org/docs/how-to-contribute/ -->
1 parent 4fd9770 commit 9280fd7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

packages/gatsby-plugin-netlify/src/constants.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ export const SECURITY_HEADERS = {
2626

2727
export const CACHING_HEADERS = {
2828
"/static/*": [`Cache-Control: public, max-age=31536000, immutable`],
29+
"/sw.js": [`Cache-Control: no-cache`],
2930
}
3031

3132
export const LINK_REGEX = /^(Link: <\/)(.+)(>;.+)/

0 commit comments

Comments
 (0)