Add /images/ to runtimeCaching

This commit is contained in:
Eric Jinks 2018-02-02 15:27:50 +10:00
parent f835940f38
commit 1089485714

View file

@ -16,8 +16,19 @@ module.exports = {
// any external urls you wish to cache (e.g. CDN)
runtimeCaching: [
{
// cache content from external url as they are loaded by browser
urlPattern: /^https?:\/\/.*example-cdn.com/,
handler: 'cacheFirst'
},
{
// cache files in the images directory as they are loaded by browser
urlPattern: '/images/(.*)',
handler: 'cacheFirst',
options: {
cache: {
name: 'images-cache'
}
}
}
]
}