0

How can I set the browser to clear the JavaScript file on every visit?

I use Firefox 3.5.7. I am also using the Firebug extension for developing.

2

I don't think there is a built-in way to stop caching of just javascript within Firefox, but you can stop Firefox from using cached files altogether , which will have the same desired effect for developing. Navigate to about:config in the address bar and filter to network.http.use-cache. Set it to false to stop Firefox from using cached files.

You can do the same with the Web Developer Toolbar:

alt text

| improve this answer | |
0

I don't know your programming skills, and why you want to clear the cache, but if you know how to build a Firefox add-on you can try removing the specified JavaScript file from the cache using the interface nsIDOMOfflineResourceList. You can get information on the MDC specific page.

Or the simple solution could be just to use Ctrl+F5 to reload the page and force the refresh. If it's for websites you develop, you can add a variable at the end of your filename (for example a timestamp or a random number), something like src="../myFile.js?random=1551533331", so the browser will think the file is different and refresh your file everytime (I have never tried it, but it should do the job).

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.