♻️(service-worker) admin NetworkOnly
We will use the NetworkOnly strategy for the admin part.
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
|||||||
CacheFirst,
|
CacheFirst,
|
||||||
NetworkFirst,
|
NetworkFirst,
|
||||||
NetworkFirstOptions,
|
NetworkFirstOptions,
|
||||||
|
NetworkOnly,
|
||||||
StrategyOptions,
|
StrategyOptions,
|
||||||
} from 'workbox-strategies';
|
} from 'workbox-strategies';
|
||||||
|
|
||||||
@@ -147,6 +148,15 @@ registerRoute(
|
|||||||
'GET',
|
'GET',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Admin cache strategy
|
||||||
|
*/
|
||||||
|
registerRoute(
|
||||||
|
({ url }) =>
|
||||||
|
url.href.includes(self.location.origin) && url.href.includes('/admin/'),
|
||||||
|
new NetworkOnly(),
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cache stategy static files images (images / svg)
|
* Cache stategy static files images (images / svg)
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user