Skip to content

Commit 2e0b6b2

Browse files
committed
♻️(service-worker) admin NetworkOnly
We will use the NetworkOnly strategy for the admin part.
1 parent edffbba commit 2e0b6b2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/frontend/apps/impress/src/features/service-worker/service-worker.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
CacheFirst,
1515
NetworkFirst,
1616
NetworkFirstOptions,
17+
NetworkOnly,
1718
StrategyOptions,
1819
} from 'workbox-strategies';
1920

@@ -147,6 +148,15 @@ registerRoute(
147148
'GET',
148149
);
149150

151+
/**
152+
* Admin cache strategy
153+
*/
154+
registerRoute(
155+
({ url }) =>
156+
url.href.includes(self.location.origin) && url.href.includes('/admin/'),
157+
new NetworkOnly(),
158+
);
159+
150160
/**
151161
* Cache stategy static files images (images / svg)
152162
*/

0 commit comments

Comments
 (0)