From fc40c495361916cb54efbc084a58d5c3101d3e5d Mon Sep 17 00:00:00 2001 From: Matthieu Auger Date: Sat, 3 Nov 2018 15:08:50 +0100 Subject: [PATCH] feat(gatsby-plugin-netlify) Do not cache service worker file 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: <\/)(.+)(>;.+)/