diff --git a/src/sw.js b/src/sw.js index 064bcf9e..cf7c7581 100644 --- a/src/sw.js +++ b/src/sw.js @@ -298,7 +298,7 @@ async function putResourcesInCache(cacheKey, paths) { } async function putPageInCache(cacheKey, page, loadRelated = true) { - const response = await putResInCache(cacheKey, page) + const response = await putResInCache(cacheKey, page.replace(/\/#.+$/, '')) if (typeof page === 'string' && page.match(/^\/(a11y|css|html|js|tools|recipes)\/.+\//)) { try { const pageJson = await (await fetch(`${page}index.json`)).json() @@ -377,11 +377,6 @@ async function cacheStrategyImpl({ cacheKey, request, preloadResponsePromise, fa return new Response() } - // Игнорирует кеширование страниц с якорями - if (request.url.indexOf('#') > -1) { - return new Response() - } - // Игнорирует кеширование запросов методом POST if (request.method === 'POST') { return new Response()