How to turn off caching on Firefox?

后端 未结 17 734
失恋的感觉
失恋的感觉 2020-11-28 00:26

During development I have to \"clear cache\" in Firefox all the time in order to make it use the latest version of JavaScript files.

Is there some kind of setting (a

相关标签:
17条回答
  • 2020-11-28 01:06

    First of All, this can be easily done, for e.g. by PHP to force the browser to renew files based on cache date (expiration time). If you just need it for experimental needs, then try to use ctrl+shift+del to clear all cache at once inside Firefox browser. The third solution is to use many add-ons that exits for Firefox to clear cache based on time lines.

    0 讨论(0)
  • 2020-11-28 01:10

    Have you tried to use CTRL-F5 to update the page?

    0 讨论(0)
  • 2020-11-28 01:10

    After 2 hours of browsing for various alternatives, this is something that worked for me.

    My requirement was disabling caching of js and css files in my spring secured web application. But at the same time caching these files "within" a particular session.

    Passing a unique id with every request is one of the advised approaches.

    And this is what I did :- Instead of

    <script language="javascript" src="js/home.js"></script>
    

    I used

    <script language="javascript" src="js/home.js?id=${pageContext.session.id}"></script>
    

    Any cons to the above approach are welcome. Security Issues ?

    0 讨论(0)
  • 2020-11-28 01:13

    If you use FireBug, on the Network tab's drop down menu there is an option do disable the browser's cache.

    0 讨论(0)
  • 2020-11-28 01:15

    In firefox 45, disk cache options can be set by changing the value of: browser.cache.disk.enable

    The value can be set on the "about:config" page.

    On http://kb.mozillazine.org/About:config_entries#Browser I found the following description for "browser.cache.disk.enable":

    True (default): Use disk cache, up to capacity specified in browser.cache.disk.capacity False: Disable disk cache (same effect as setting browser.cache.disk.capacity to 0)

    0 讨论(0)
  • 2020-11-28 01:16

    You can use CTRL-F5 to reload bypassing the cache.

    You can set the preferences in firefox not to use the cache

    network.http.use-cache = false
    

    You can setup you web server to send a no-cache/Expires/Cache-Control headers for the js files.

    Here is an example for apache web server.

    0 讨论(0)
提交回复
热议问题