Skip to content

Commit d427663

Browse files
authored
fix(sw): use NetworkFirst strategy for page-data (#24940)
* fix(sw): use NetworkFirst strategy for page-data Fixes #24930 * fix(sw): NetworkFirst strategy for app-data.json * fix(sw): StaleWhileRevalidate for page-data and app-data
1 parent 13aaa16 commit d427663

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/gatsby-plugin-offline/src/gatsby-node.js

+5
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,11 @@ exports.onPostBuild = (
143143
urlPattern: /^https?:.*\page-data\/.*\/page-data\.json/,
144144
handler: `StaleWhileRevalidate`,
145145
},
146+
{
147+
// app-data.json is not content hashed
148+
urlPattern: /^https?:.*\/page-data\/app-data\.json/,
149+
handler: `StaleWhileRevalidate`,
150+
},
146151
{
147152
// Add runtime caching of various other page resources
148153
urlPattern: /^https?:.*\.(png|jpg|jpeg|webp|svg|gif|tiff|js|woff|woff2|json|css)$/,

0 commit comments

Comments
 (0)