changes not reflecting in service-worker unless I delete cookie/cache -
i using service worker implement web push notifications. whenever change code of service-worker, change not reflected in service-worker on browser unless delete cookie/cache. normal behaviour or have add function update service-worker?
service worker files cached max of 24 hours if cache header sent service worker file.
first step set cache headers 0 not cache.
when browser finds new service worker download , install it. won't take affect until pages controlled service worker closed. normal user isn't problem. during development in chrome can use ctrl+ shift + r hard refresh forces page not controlled service worker, allowing service worker take control on next refresh.
final option use skip waiting in install step , claim in activate step force new service worker instantly activate , control pages. if earn against it's easy weird scenarios.
Comments
Post a Comment