mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-01-27 14:01:15 +01:00
Merge pull request #837 from tranlehaiquan/bugfix/gatsby-plugin-offline-cache-github-branch-static
bugfix/ Edit gatsby plugin offline prevent cache static/media
This commit is contained in:
commit
5ef540224c
@ -189,7 +189,36 @@ module.exports = {
|
|||||||
icon: 'static/photo.jpg'
|
icon: 'static/photo.jpg'
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
'gatsby-plugin-offline',
|
{
|
||||||
|
resolve: 'gatsby-plugin-offline',
|
||||||
|
options: {
|
||||||
|
workboxConfig: {
|
||||||
|
runtimeCaching: [{
|
||||||
|
// Use cacheFirst since these don't need to be revalidated (same RegExp
|
||||||
|
// and same reason as above)
|
||||||
|
urlPattern: /(\.js$|\.css$|[^:]static\/)/,
|
||||||
|
handler: 'CacheFirst',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// page-data.json files, static query results and app-data.json
|
||||||
|
// are not content hashed
|
||||||
|
urlPattern: /^https?:.*\/page-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)$/,
|
||||||
|
handler: 'StaleWhileRevalidate',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
// Google Fonts CSS (doesn't end in .css so we need to specify it)
|
||||||
|
urlPattern: /^https?:\/\/fonts\.googleapis\.com\/css/,
|
||||||
|
handler: 'StaleWhileRevalidate',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
'gatsby-plugin-catch-links',
|
'gatsby-plugin-catch-links',
|
||||||
'gatsby-plugin-react-helmet',
|
'gatsby-plugin-react-helmet',
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user