Firefox browser does not reload the update CSS/JS files

折月煮酒 提交于 2019-12-01 05:57:28

问题


I'm having a problem in the firefox browser, because everytime I update my CSS or JS files, I need to clear the cache of my firefox browser to get the updated files. I'm using XSP2 server because I developed my webapp using C# and asp.net in ubuntu.

Is there any way to automatically reload the updated CSS/JS files in the firefox browser and implemented in server-side or in my webapps?

Please advise.

Many thanks.


回答1:


You could mess with the cache of the headers, but the easiest thing to do is simply append your updated elements with a querystring when you want them to change...

I know this doesn't sound like a good solution, but when you begin minifying and combining your js and css files for performance reasons, most of the solutions will change the url to get these resources when they change anyway...




回答2:


Hold the CTRL button and press F5. It's a hard refresh that clears the cache for the page you just refreshed.

If you want to auto-reload other users browsers, use a random variable on the end of the src/href tag. Like:

<script type="text/javascript" src="dothis.js?r=591"></script>

If the src is always changing, the browser will reload the script without using cache.




回答3:


This is what I use: https://addons.mozilla.org/en-US/firefox/addon/clear-cache-button/

Alternatively, set your cache to use 0 MB: Go to Preferences -> Advanced -> Network -> check override automatic cache management, and set to 0MB.




回答4:


There are a couple of ways to make sure the users see the latest content on your web pages. Refresh the pages at certain time intervals or block the browser from caching the web page, each time they return they will load the data fresh.

===== Do not allow the user to store the data in cache at all:

<META HTTP-EQUIV="Pragma" CONTENT="no-cache"> 

Add this between the and tag and the page will never be cashed in the first place.

===== Refresh the page after a certain time interval:

<meta HTTP-EQUIV="Refresh" CONTENT=300>

Add this between the and tag and the page will never be cashed in the first place.


Another solution : Here


or :

<%@ OutputCache Location="None" VaryByParam="None" %>

source : Here



来源:https://stackoverflow.com/questions/6770020/firefox-browser-does-not-reload-the-update-css-js-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!