const navigationHandler = async (params) => {
try {
// Attempt a network request.
return await new workbox.strategies.StaleWhileRevalidate({
cacheName: "navigation-and-route",
plugins: [
new workbox.broadcastUpdate.BroadcastUpdatePlugin('workbox-broadcast-update'),
new workbox.expiration.ExpirationPlugin({
maxEntries: 20,
maxAgeSeconds: 7 * 24 * 60 * 60, // 1 week
purgeOnQuotaError: true,
}),
],
}).handle(params);
} catch (error) {
// If it fails, return the cached HTML.
return caches.match(FALLBACK_HTML_URL, {
cacheName: OFFLINE_CACHE_NAME,
});
}
};
// Register this strategy to handle all navigations.
workbox.routing.registerRoute(
new workbox.routing.NavigationRoute(navigationHandler, {
denylist: [
new RegExp('admin|cpa|work|map'),
],
})
);
Кто нибудь может подсказать почему при StaleWhileRevalidate кеш для html не обновляется?