You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 13, 2022. It is now read-only.
The provided service worker uses two caches: cacheTTT for static assets and bundled resources, and offlineTTT for other cached resources (with TTT a timestamp generated by Sapper).
But static assets and bundled JS resources are present in both caches:
in the first one when the service worker is initially populated by the 'install' event,
in the second one when we browse on the website.
The second one is because this condition cached.has(url.pathname) is never met because url.pathname has an initial slash (or other base URL) and the cached set is only relative to the base URL without any initial slash.
It works better (the second cache is no more populated by static assets and bundled JS resources and the service worker continues to deliver these resources) when the base URL is removed from url.pathname: cached.has(url.pathname).substring(1) where the website is on the root base URL. But I don’t know if the service worker knows its own base URL to do it programmatically without assumption on the base URL.
The text was updated successfully, but these errors were encountered:
Seb35
added a commit
to Legilibre/archeo-lex.fr
that referenced
this issue
Apr 19, 2019
The provided service worker uses two caches: cacheTTT for static assets and bundled resources, and offlineTTT for other cached resources (with TTT a timestamp generated by Sapper).
But static assets and bundled JS resources are present in both caches:
The second one is because this condition
cached.has(url.pathname)
is never met becauseurl.pathname
has an initial slash (or other base URL) and thecached
set is only relative to the base URL without any initial slash.It works better (the second cache is no more populated by static assets and bundled JS resources and the service worker continues to deliver these resources) when the base URL is removed from url.pathname:
cached.has(url.pathname).substring(1)
where the website is on the root base URL. But I don’t know if the service worker knows its own base URL to do it programmatically without assumption on the base URL.The text was updated successfully, but these errors were encountered: