Firefox browser does not reload the update CSS/JS files

8.3k views Asked by At

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.

4

There are 4 answers

1
ar3 On BEST ANSWER

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...

1
jbeard4 On

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.

0
xsari3x On

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

2
Nahydrin On

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.