From 9280fd70a787bd462d899c654f57eaa7a589c67c Mon Sep 17 00:00:00 2001 From: Matthieu Auger Date: Thu, 15 Nov 2018 15:43:37 +0100 Subject: [PATCH] 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 : https://github.com/w3c/ServiceWorker/issues/893 --- packages/gatsby-plugin-netlify/src/constants.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/gatsby-plugin-netlify/src/constants.js b/packages/gatsby-plugin-netlify/src/constants.js index 88ad51b7fbc9c..cfcc302f9fd01 100644 --- a/packages/gatsby-plugin-netlify/src/constants.js +++ b/packages/gatsby-plugin-netlify/src/constants.js @@ -26,6 +26,7 @@ export const SECURITY_HEADERS = { export const CACHING_HEADERS = { "/static/*": [`Cache-Control: public, max-age=31536000, immutable`], + "/sw.js": [`Cache-Control: no-cache`], } export const LINK_REGEX = /^(Link: <\/)(.+)(>;.+)/