mirror of
https://github.com/betagouv/mon-entreprise
synced 2025-02-10 13:55:03 +00:00
chore: ajout d'un cache Piano
This commit is contained in:
parent
d8b7cc4708
commit
4aa505021f
1 changed files with 17 additions and 0 deletions
|
@ -72,6 +72,23 @@ const networkFirstJS = new Route(
|
|||
|
||||
registerRoute(networkFirstJS)
|
||||
|
||||
const networkFirstPiano = new Route(
|
||||
({ url }) => {
|
||||
return url.hostname === 'tag.aticdn.net'
|
||||
},
|
||||
new NetworkFirst({
|
||||
cacheName: 'piano-cache',
|
||||
plugins: [
|
||||
new ExpirationPlugin({
|
||||
maxAgeSeconds: 1 * MONTH,
|
||||
maxEntries: 40,
|
||||
}),
|
||||
],
|
||||
})
|
||||
)
|
||||
|
||||
registerRoute(networkFirstPiano)
|
||||
|
||||
const staleWhileRevalidate = new Route(
|
||||
({ request, sameOrigin, url }) => {
|
||||
return (
|
||||
|
|
Loading…
Add table
Reference in a new issue