Skip to content

Commit

Permalink
docs(gatsby-plugin-offline): Change runtimeCaching handlers (#21494)
Browse files Browse the repository at this point in the history
Change docs to be compliant with the code: https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-offline/src/gatsby-node.js#L132

And using current example from docs prints following error to console:
```
Specifying 'cacheFirst'' in a 'runtimeCaching[].handler' option is deprecated. Please update your config to use 'CacheFirst'
```
  • Loading branch information
gglukmann authored Feb 15, 2020
1 parent 8fd5877 commit 8c15911
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/gatsby-plugin-offline/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,22 +143,22 @@ const options = {
// Use cacheFirst since these don't need to be revalidated (same RegExp
// and same reason as above)
urlPattern: /(\.js$|\.css$|static\/)/,
handler: `cacheFirst`,
handler: `CacheFirst`,
},
{
// page-data.json files are not content hashed
urlPattern: /^https?:.*\page-data\/.*\/page-data\.json/,
handler: `networkFirst`,
handler: `NetworkFirst`,
},
{
// Add runtime caching of various other page resources
urlPattern: /^https?:.*\.(png|jpg|jpeg|webp|svg|gif|tiff|js|woff|woff2|json|css)$/,
handler: `staleWhileRevalidate`,
handler: `StaleWhileRevalidate`,
},
{
// Google Fonts CSS (doesn't end in .css so we need to specify it)
urlPattern: /^https?:\/\/fonts\.googleapis\.com\/css/,
handler: `staleWhileRevalidate`,
handler: `StaleWhileRevalidate`,
},
],
skipWaiting: true,
Expand Down

0 comments on commit 8c15911

Please sign in to comment.