Skip to content

Commit

Permalink
CB-5450 cache only images from the same origin
Browse files Browse the repository at this point in the history
  • Loading branch information
devnaumov committed Sep 16, 2024
1 parent 67f5190 commit a81d22d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions webapp/packages/core-browser/src/service-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,13 @@ registerRoute(
new ExpirationPlugin({
maxEntries: 1000,
maxAgeSeconds: 7 * 24 * 60 * 60,
purgeOnQuotaError: true,
}),
],
}),
);

registerRoute(
({ request }) => request.destination === 'image',
({ request, url }) => url.origin === window.location.origin && request.destination === 'image',
new CacheFirst({
cacheName: 'images',
plugins: [
Expand All @@ -128,7 +127,6 @@ registerRoute(
new ExpirationPlugin({
maxEntries: 1000,
maxAgeSeconds: 7 * 24 * 60 * 60,
purgeOnQuotaError: true,
}),
],
}),
Expand Down

0 comments on commit a81d22d

Please sign in to comment.