Clear cached JavaScript includes in Firefox

后端 未结 6 1795
生来不讨喜
生来不讨喜 2021-02-01 18:05

I\'m working on JavaScript for a site, developing with Firefox, and when I refresh the page, I don\'t see my changes. The JavaScript file is in an external file. I reloaded and

6条回答
  •  时光说笑
    2021-02-01 18:44

    Browsers have user-facing facilities to clear the cache. Usually it's a menu option somewhere. You can't force the cache to be cleared.

    What you can do is arrange for your scripts to be loaded from URLs that vary according to version number (or whatever):

    
    

    Now when you update the code, you update the pages that use it:

    
    

    That's a different URL, and it won't be in the cache.

提交回复
热议问题