mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-30 23:06:10 +03:00
Use runtime caching for .js and .html files.
This commit is contained in:
parent
936f278e32
commit
87767bab6f
@ -191,7 +191,7 @@ function webpackOptions(production, routes, { debug, manifestConfig }) {
|
||||
}),
|
||||
new InjectManifest({
|
||||
swSrc: path.resolve(__dirname, "./service-worker-template.js"),
|
||||
include: [/^index\.html$/, /\.js$/, /\.(?:png|gif|jpg|jpeg|svg)$/],
|
||||
include: [],
|
||||
exclude: [
|
||||
/android-chrome-.*\.png$/,
|
||||
/apple-touch-icon.*\.png/,
|
||||
|
@ -14,6 +14,14 @@ workbox.routing.registerRoute(
|
||||
}),
|
||||
"GET"
|
||||
);
|
||||
workbox.routing.registerRoute(
|
||||
/(^index\.html$|.js$)/,
|
||||
new workbox.strategies.NetworkFirst({
|
||||
cacheName: "shell",
|
||||
plugins: []
|
||||
}),
|
||||
"GET"
|
||||
);
|
||||
workbox.routing.registerRoute(
|
||||
/^https:\/\/fonts\.googleapis\.com/,
|
||||
new workbox.strategies.StaleWhileRevalidate({
|
||||
|
Loading…
Reference in New Issue
Block a user