Skip to content

Commit

Permalink
fix(sw): use NetworkFirst strategy for page-data (#24940)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
nibtime authored Jun 18, 2020
1 parent 13aaa16 commit d427663
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/gatsby-plugin-offline/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ exports.onPostBuild = (
urlPattern: /^https?:.*\page-data\/.*\/page-data\.json/,
handler: `StaleWhileRevalidate`,
},
{
// app-data.json is not content hashed
urlPattern: /^https?:.*\/page-data\/app-data\.json/,
handler: `StaleWhileRevalidate`,
},
{
// Add runtime caching of various other page resources
urlPattern: /^https?:.*\.(png|jpg|jpeg|webp|svg|gif|tiff|js|woff|woff2|json|css)$/,
Expand Down

0 comments on commit d427663

Please sign in to comment.