Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm using Firefox 3.5.2. For some reason, it has cached a page and won't update. For example, I added an alert('test'); statement to some JavaScript code which is loaded on the page, but Firefox doesn't see it. When I do a view source, I still see the old code.

So I'm guessing this is a cache issue. How can I fix it, or can I make Firefox never cache anything from http://localhost?

share|improve this question

7 Answers 7

up vote 24 down vote accepted

You can force all requests relating to a refresh to actually be requested from the server (bypassing any already cached content, and updating the cache with the new version) by using Ctrl+F5 instead of just F5.

This does not work for requests made by the page within client-side code though. When that is a problem you need to use the POST method (POST requests should never be cached) instead of GET or add an ever-changing value to the query string (such as the current time in ms).

share|improve this answer
10  
Also ctrl+shift+R, which doesn't require as large a hand spread if done one-handed. –  Anonymous Dec 25 '09 at 4:41
1  
Another trick is to add a question mark to the end of the url. –  emgee Apr 4 '11 at 23:32
1  
What is the mac shortcut? –  jdln Apr 15 '13 at 13:24
    
for mac its Shift+CMD+R –  Marcel Aug 27 '13 at 4:14
    
Using angular to fetch templates with XHR calls you can press the entire keyboard with F5 but it'll still fetch the cached template. Do does any ajax request from script. –  HMR Jul 17 at 13:29

Turn off the caching for a particular page. the correct way is to set the cache directive in Http request:

Cache-Control: no-cache

turn the entire Firefox caching capability off through its about:config page

network.http.use-cache = false.
share|improve this answer
4  
Spot on with about:config. When using the HttpFox extension, I’ve found that Cmd+Shift+R (I’m on a Mac) doesn’t always result in everything being fetched from the cache. Turning the cache off in about:config seems to work reliably though. –  Paul D. Waite Oct 15 '10 at 11:49
3  
Note that this should be the accepted answer, the one that's accepted is useless. –  Nathan C. Tresch Sep 13 '13 at 14:55

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

share|improve this answer

If you install the Web Developer addon, it gives you an extra toolbar where you can disable the cache among other things. I highly recommend that and Firebug if you are working on webpages or scripts.

share|improve this answer

Firefox addon CacheViewer allows you to explicitly delete a specific cached page.
I find it quite useful when Superuser-Beta updates and my cache causes things to vanish from the edit pages.

There is one more addon called JohnnyCache at this article.

In theory, Johnnycache can prevent cache access for individual files or paths - which would be perfection. In practice, this doesn't work in some cases (maybe I'm giving it the wrong path somehow).

You can use Johnnycache to block caching for the entire site under development (just use yoursitename.com). This always works, but it can slow down loading of complex pages. But I'd suggest doing this when you first install Johnnycache, to get an idea how it works.

The bad thing is that Johnnycache doesn't work for Firefox 26.0

share|improve this answer

I would say that the best way I have found is to click on TOOLS in firefox and start private browsing which does not cache any pages and will restore any pages you had open prior to going in to PRIVATE BROWSING. Nice feature.

share|improve this answer

On Firefox 4, use about:config. In the filter, type cache. Toggle all toggles to false. Be careful, don't change any sizes, just the toggles.

Then use Ctrl + F5 for the refreshes. This also works well for page speed testing.

share|improve this answer
    
is there any way to reliably test that the cache is disabled for good? –  Xonatron Feb 15 '12 at 17:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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