попытка победить кэш
This commit is contained in:
@@ -33,6 +33,14 @@ http {
|
|||||||
add_header Expires "0";
|
add_header Expires "0";
|
||||||
try_files $uri =404;
|
try_files $uri =404;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Для файла index.html – тоже не кэшируем
|
||||||
|
location = /index.html {
|
||||||
|
add_header Cache-Control "no-cache, no-store, must-revalidate";
|
||||||
|
add_header Pragma "no-cache";
|
||||||
|
add_header Expires "0";
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
|
||||||
# Основной SPA fallback: все неизвестные пути отдаём через index.html
|
# Основной SPA fallback: все неизвестные пути отдаём через index.html
|
||||||
location / {
|
location / {
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ const manifestUrlList = self.assetsManifest.assets.map(asset => new URL(asset.ur
|
|||||||
async function onInstall(event) {
|
async function onInstall(event) {
|
||||||
console.info('Service worker: Install');
|
console.info('Service worker: Install');
|
||||||
|
|
||||||
|
self.skipWaiting();
|
||||||
|
|
||||||
// Fetch and cache all matching items from the assets manifest
|
// Fetch and cache all matching items from the assets manifest
|
||||||
const assetsRequests = self.assetsManifest.assets
|
const assetsRequests = self.assetsManifest.assets
|
||||||
.filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
|
.filter(asset => offlineAssetsInclude.some(pattern => pattern.test(asset.url)))
|
||||||
@@ -30,6 +32,8 @@ async function onInstall(event) {
|
|||||||
async function onActivate(event) {
|
async function onActivate(event) {
|
||||||
console.info('Service worker: Activate');
|
console.info('Service worker: Activate');
|
||||||
|
|
||||||
|
await self.clients.claim();
|
||||||
|
|
||||||
// Delete unused caches
|
// Delete unused caches
|
||||||
const cacheKeys = await caches.keys();
|
const cacheKeys = await caches.keys();
|
||||||
await Promise.all(cacheKeys
|
await Promise.all(cacheKeys
|
||||||
|
|||||||
Reference in New Issue
Block a user