If I edit my web worker script and refresh the page, the web worker script is a cached version. I am reasonably confident it is not my webserver, because I can immediately load the latest copies of all other files, and even restarting the webserver does not fix the problem. It only loads the newest version of the web worker script if I reboot chrome, which is highly inefficient, needless to say! It doesn't fix it even if I restart chrome. Is there anything I can do to get around this?
相关问题
- Is there a limit to how many levels you can nest i
- How to toggle on Order in ReactJS
- void before promise syntax
- Keeping track of variable instances
- Can php detect if javascript is on or not?
Your web server determines how cachable a given web resource is and the browser attempts to respect those settings, caching resources that the web server says it is OK to cache, not caching things it says shouldn't be cached.
If you want to change that, you have these options:
You must close all tabs which opening this page. Open only one 1 then Ctrl + Shift + R to refresh then the cache will be clear.
In your
install
event, before the call toevent.waitUntil
add:Source
Also, you can follow this development workflow:
Source
Add
<script src="your_worker_path"></scripts>
to your page head to force cache update.Include code of your worker in
if(typeof window == "undefined"){...}
to avoid it starting on page reloadOn my Linux Chrome I have to right click (or long click) the reload button and select "Empty Cache and Hard Reload" to get the latest version
Did you try a hard refresh? Ctrl-r?