smaller avatar cache, exclude gifs from img cache
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
8c8a7c7e88
commit
d3c9fef9af
@ -55,7 +55,7 @@ registerRoute(
|
|||||||
cacheName: "avatar-cache",
|
cacheName: "avatar-cache",
|
||||||
plugins: [
|
plugins: [
|
||||||
new ExpirationPlugin({
|
new ExpirationPlugin({
|
||||||
maxEntries: 1000,
|
maxEntries: 200, // gif avatars can still be large
|
||||||
matchOptions: {
|
matchOptions: {
|
||||||
ignoreVary: true,
|
ignoreVary: true,
|
||||||
},
|
},
|
||||||
@ -69,8 +69,8 @@ registerRoute(
|
|||||||
|
|
||||||
// Cache images from any domain
|
// Cache images from any domain
|
||||||
registerRoute(
|
registerRoute(
|
||||||
// Match any image request regardless of the origin
|
// match images except gif
|
||||||
({ request }) => request.destination === "image",
|
({ request, url }) => request.destination === "image" && !url.pathname.endsWith(".gif"),
|
||||||
new CacheFirst({
|
new CacheFirst({
|
||||||
cacheName: "image-cache",
|
cacheName: "image-cache",
|
||||||
plugins: [
|
plugins: [
|
||||||
|
Loading…
Reference in New Issue
Block a user