Skip to content

Commit

Permalink
fix(gatsby-plugin-offline): use networkFirst caching for page-data.js…
Browse files Browse the repository at this point in the history
…on files (#14720)

* In plugin-offline, use networkFirst caching for page-data.json files

* fix page-data offline regex
  • Loading branch information
Moocar authored and KyleAMathews committed Jun 12, 2019
1 parent 16f0baf commit 5352411
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 @@ -90,6 +90,11 @@ exports.onPostBuild = (args, pluginOptions) => {
urlPattern: /(\.js$|\.css$|static\/)/,
handler: `cacheFirst`,
},
{
// page-data.json files are not content hashed
urlPattern: /^https?:.*\page-data\/.*\/page-data\.json/,
handler: `networkFirst`,
},
{
// 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 5352411

Please sign in to comment.