How can I clear a single site from the cache in Firefox?

281

52

In Firefox, I occasionally need to clear my cache to fix a website. But clearing the entire cache seems like extreme overkill. Is there any way to just clear the one site from my cache?

Ryan C. Thompson

Posted 2010-08-07T17:33:06.007

Reputation: 10 085

1When I need to debug my site with the Cookie cleaned frequently, I often use the private browsing mode. It will clean everything automatically. Hope this can fit your scenario. – smwikipedia – 2015-12-04T09:55:50.867

Answers

263

  1. Select the Firefox Menu button.
  2. (Within Firefox 57 or newer, select Library)
  3. Select the History icon.
  4. Scroll to the bottom and select Show All History.
  5. Search for the site using the Search History field in the upper-right corner.
  6. Within the results, right-click the appropriate page and select Forget About This Site.

Note: This will clear saved passwords for the site as well.

zylstra

Posted 2010-08-07T17:33:06.007

Reputation: 2 951

Great answer, but just made Firefox crash :) – Nick – 2014-07-05T02:04:58.507

4This is a great alternative to CTRL+F5 when you want to remove the cache of a website which redirects you to another website (in which case CTRL+F5 only force refreshes the redirected website). – Sicco – 2014-09-04T14:35:38.053

This also works where I was developing example.com on example.com.preview-service.example.net. Now it's gone live, Firefox keeps suggesting the preview domain name to me when I start typing. Telling it to forget about the site is a wonderful solution. Thank you. – TRiG – 2014-10-14T14:57:31.447

15A good answer but people need to know about the problem! So: W A R N I N G: This will clear ALL info about that web site including cookie and passwords. – Ultralisk – 2015-01-30T16:03:11.993

@Sicco CTRL+F5 was not solving my caché issue with a http to https redirection and yes, delete ALL cache it's so extreme. Would love a direct button with "Clear this". – m3nda – 2015-05-29T19:18:12.577

3Also, if that site is localhost, it will lose data for all localhost sites that you're developing, which is, for me anyway, far more than I want to clear. – Joshua Frank – 2015-07-03T12:41:37.690

@hstoerr history may be different from cache, but using my method does remove the site from cache - for me at least. I didn't use the plugin, but I did view about:cache. Perhaps you remained on the forgotten page and dynamic page elements loaded elements from that site, which you then saw in your cache. Or perhaps the plugin is not real-time. – zylstra – 2015-09-26T22:15:34.437

@zylstra Oops, sorry! I tried it again, and removing the site from the history indeed cleared the cache, too. No idea what I did wrong the first time. – Hans-Peter Störr – 2015-09-29T06:31:05.943

7The question was to delete the site from the browser cache, and not from the history. This answer is bad. – peterh - Reinstate Monica – 2016-11-22T11:00:07.140

@peterh, apparently (from the votes and comments) the answer correctly answers the question, i.e. how to delete a site from the browser's cache. I'd call that a good, rather than bad, answer. – zylstra – 2016-11-24T18:49:11.020

2

@zylstra I admit the vote count; which clearly means the answer helped a lot thus it is useful; despite that I can't agree it would be an answer to the original question. Check this.

– peterh - Reinstate Monica – 2016-11-24T22:01:54.580

Based on my experience with FF so far (from version 40-something up to the nightly build from yesterday), this clears ALL entries in the browser cache (except for a very few particular websites, whose behaviour I have yet to investigate), not just the site that you are trying to forget; so BEWARE! – Janaka Bandara – 2017-08-25T18:15:40.913

@JoshuaFrank you can mitigate the issue with the use of vhosts on your localhost for different sites you're developing, this should resolve your issue and seems to be more appropriate way of handling the case of developing multiple sites. – tymik – 2017-11-10T09:35:32.303

What's vhosts, and can it be used with Visual Studio on Windows? – Joshua Frank – 2017-11-11T11:59:01.133

Looks like we have a winner! I guess this was added somewhat recently? – Ryan C. Thompson – 2014-03-25T17:17:25.657

5You're still here! Three and a half years later. :) To answer you: yep, "yesterday". Thanks for the kudos. – zylstra – 2014-03-26T18:52:32.947

38

If you want to do a force-refresh, which is what I think you want to do, hit CTRL+F5. And of course, Cmd+F5 on a Mac. Works on Chrome too.

digitxp

Posted 2010-08-07T17:33:06.007

Reputation: 13 502

@HMR it get's upvotes because it makes the browser re request the cashed assets while not erasing the passwords and cookies of the website. – Accountant م – 2018-08-18T15:43:10.460

3loads voiceover in osx 10.6.7 – Doug Molineux – 2011-04-07T22:37:41.573

6CMD + SHIFT + R ... the function keys are per default used by OSX. – curly_brackets – 2011-10-17T09:32:44.613

4That's not necessarily true. Resources like html templates are cached every time I'm trying to develop. – James South – 2012-04-02T18:19:36.090

4any idea how to do this for a page that was using a 301 redirect to another domain, but is no longer? I haven't been able to hit ctrl-F5 fast enough, and the redirect keeps happening – matt wilkie – 2012-04-18T05:06:23.727

2This only clears THAT page from the cache. from the cited page above: "To force a reload of everything on the page,...use the hotkey combination Ctrl-F5." – Clay Nichols – 2012-12-28T19:45:04.263

1To clarify what Clay is saying, the problem with CTRL+F5 is that it only forces a refresh of that particular page and the resources it links to (with <link>, not <a>). That leaves every other page on the site potentially out of step with the CSS and JS that you might just have refreshed. – Lawrence Dol – 2013-02-09T02:01:30.983

1Does not work if the site uses cached ajax calls :S – inf3rno – 2013-04-23T15:13:13.627

21Don't understand why this answer get's upvoted so much as it's both wrong and doesn't answer the question. Ajax calls, css files, redirects keep being cached (or redirects). The only sure way would be an option to remove history from a certain domain like with removing cookies. Another way is to start firefox with a different (cleaned) profile. – HMR – 2013-09-15T03:18:39.810

1@matt — Try with turning on the warning before redirect, in the Prefs → Advanced → General → Accessibility. But this pref does not work in all cases. – Nicolas Barbulesco – 2014-04-27T07:11:43.010

6

this addon will allow you view and delete specific cache entries from memory and disk - https://addons.mozilla.org/en-US/firefox/addon/2489/

bryan

Posted 2010-08-07T17:33:06.007

Reputation: 7 848

CacheViewer2 does indeed delete cache entries as of version 1.7.2.1-signed, and perhaps earlier. – Chris Granger – 2016-03-12T06:50:03.020

"Not compatible with Firefox Quantum" – Accountant م – 2018-08-18T15:53:11.560

4Sadly, the addon is not available anymore at present. – equaeghe – 2013-11-30T21:43:05.047

2

Have a look at this https://addons.mozilla.org/de/firefox/addon/cacheviewer2/

– iceteea – 2013-12-03T10:25:22.927

This add-on is not in stable version. – Nicolas Barbulesco – 2014-04-27T06:50:32.513

Apparently, this add-on cannot be hot-installed. This is too bad. I need to make some specific sites work again in Firefox, without relaunching Firefox. – Nicolas Barbulesco – 2014-04-27T06:52:22.373

@iceteea — This add-on CacheViewer2 is not in stable version. And, apparently, this add-on cannot be hot-installed. This is too bad. I need to make some specific sites work again in Firefox, without relaunching Firefox. – Nicolas Barbulesco – 2014-04-27T06:54:27.050

@iceteea — Apparently, this add-on CacheViewer2 does not delete cache entries, but only allows the user to view and save them. – Nicolas Barbulesco – 2014-04-27T06:55:36.223

4

Please note that there is currently no way to clear cached HTTP redirects (at least 301 type) without using a plugin.

Ctrl+F5 / Cmd+F5 does not work as you are being immediately redirected to the target URL so you can not refresh the original one.

So I used CacheViewer plugin mentioned here before to deal with this.

See also this bug in Firefox for details and possible progress on this issue.

Greg Dubicki

Posted 2010-08-07T17:33:06.007

Reputation: 255

1I wonder if that Firefox bug isn't simply about 301 Moved Permanently redirects, which are, well, designed to be permanent. If Firefox would indeed cache 302 Found, then that would indeed be a bug. – Arjan – 2015-07-24T07:13:30.700

You are generally right about 301 @Arjan but I would say it's at least a questionable behaviour to cache a redirect resulting in 4xx/5xx response. And also not being able to clear these redirects cache without a third-party tool seems to be more like a bug than a lack of a feature.. – Greg Dubicki – 2015-07-24T13:12:22.200

You may try with turning on the warning before redirect, in the Prefs → Advanced → General → Accessibility. But this pref does not work in all cases. – Nicolas Barbulesco – 2014-04-27T07:13:36.737

2

In what seems to be a just released Firefox extension, the original question now has an answer which is both a direct solution to the problem posed (not how to also remove cookies, passwords, etc from the selected domain which happens through the use of "Forget about this site") and will handle websites which utilise a page redirect rather than a page content change that is undesirably cached. Great design also. Quick and efficient.

https://addons.mozilla.org/en-US/firefox/addon/clear-site-cache/

user66001

Posted 2010-08-07T17:33:06.007

Reputation: 1 050

2Not compatible with Firefox Quantum – rluks – 2018-06-15T17:54:42.887

2

There is no built in way to clear the cache of specific pages/sites in Firefox. You can "Forget about this site" which cleans the domain from history, you can "Delete this page" which cleans the specific page from history, but you can't clean up single cache items belonging to a page (apart from going to your profile folder and deleting them).

There may be addons to do this, but I didn't find anything when looking through them. Built-In functionality for cache deletion seems to have the all-or-nothing policy.

private_meta

Posted 2010-08-07T17:33:06.007

Reputation: 2 204

2Where are the options you mentioned for "Forget about this site" and "Delete this page"? – mouseas – 2012-06-20T17:16:12.120

@mouseas, at least the history sidebar (Ctrl-H). – Matthew Flaschen – 2013-05-17T21:20:11.807

@mouseas Those two commands are at the bottom of the right-click menu of any individual page in history, in the History window or sidebar. – Rory O'Kane – 2013-07-18T19:18:59.713

2

One day when you have not opened anything else, go to Tools ⇨ Clear recent history and then select to only clear the cache and then only from today or Xtime. Because you just visited the website, it should have moved its timestamps in the cache to the top of the list so you can just wipe all cache from Firefox for that day and thus clear the cache for your specific website.

Sol

Posted 2010-08-07T17:33:06.007

Reputation: 31

A lot of trouble to go to for such a trivial purpose. – Isaac Rabinovitch – 2012-11-19T22:04:01.503

1

I'm kinda late to the party here, but I wanted to leave this answer for people who found this thread through googling like I did. The problem was solved for me by accessing Firefox's profile selector (Windows -> Run -> "Firefox.exe -p"), using a new profile and visiting the website from there. Then when I went back to my regular profile, the website began working normally again! Opening it on the other profile must have refreshed my regular profile's cache with non-corrupt versions of the files.

Nantes

Posted 2010-08-07T17:33:06.007

Reputation: 11

1

Another approach would be to use Firefox's containers - create a fresh container tab/window using (using a container add-on e.g. Temporary containers, or Mozilla's Multi-account container add-on) and load your site in that container - a fresh/temporary container will have empty login, cache etc so will act like you've cleared these.

Pierz

Posted 2010-08-07T17:33:06.007

Reputation: 880

1

There's a similar question and answers shortly are:

  • You can use Firefox by 2 profiles.
  • There's a extension named CookieMonster may works for you.
  • There are two add-ons for FF that every web developer needs and they are Web Developer Toolbar and Firebug, the Firebug extension YSlow comes in very handy too.
    Web Developer Toolbar has great cache and cookie control down to individual cookies.
  • Ctrl-F5 is enough usually.

Amir Latifi

Posted 2010-08-07T17:33:06.007

Reputation: 159

6Those are mostly for cookies. I just care about dropping a domain from cache. – Ryan C. Thompson – 2010-08-07T20:54:02.760

1Thank you for this summary. But Cookie Monster is not a cookie. Cookie Monster is an extension for Firefox. – Nicolas Barbulesco – 2014-04-27T07:00:43.237

@NicolasBarbulesco Right, I changed the text. – Amir Latifi – 2014-04-27T09:16:27.390

0

If you know the exact list of URLs that you need to clear from the cache (e.g. the corrupted CSS entry/ies from the site in question), you can clear them using this script (adapted from DoomEntry.js; needs to be run on the Browser Console (Ctrl+Shift+J), not the Web Console (Ctrl+Shift+K):

// load the disk cache
var cacheservice = Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
    .getService(Components.interfaces.nsICacheStorageService);
var {LoadContextInfo} = Components.utils.import("resource://gre/modules/LoadContextInfo.jsm",{})
var hdcache = cacheservice.diskCacheStorage(LoadContextInfo.default, true);

// compose the URL and submit it for dooming
var uri = Components.classes["@mozilla.org/network/io-service;1"]
    .getService(Components.interfaces.nsIIOService).newURI(prompt("Enter the URL to kick out:"), null, null);
hdcache.asyncDoomURI(uri, null, null);

Simply run the script with each URL that you need to purge (or make up a loop... you know the drill).

Theoretically this should clear cached AJAX responses, other asynchronously loaded resources, and 301 redirect entries as well (as long as you enter the original (pre-301) URL).

Janaka Bandara

Posted 2010-08-07T17:33:06.007

Reputation: 250

EDIT: since FF 60, lines 2-3 should be replaced with var hdcache = cacheservice.diskCacheStorage(Services.loadContextInfo.default, true);; kudos to https://bugzilla.mozilla.org/show_bug.cgi?id=1417937. (For some reason I'm not allowed to edit my original answer.)

– Janaka Bandara – 2018-04-01T10:47:36.733

0

Looks like they might of changed a few things. I found the following:

  1. Menu -> Options
  2. Privacy & Security -> Site Data -> Settings
  3. Highlight the Selected Site and select Remove Selected
  4. Select Save Changes
  5. Finally click Remove

Settings Dialog Remove Selected Dialog Confirmation Dialog

Andy Braham

Posted 2010-08-07T17:33:06.007

Reputation: 123

I could be wrong but it looks like this option only selects sites that have stored temporary data. For *those* sites, yes, it clears cookies and everything else. For a site that has *not* stored temporary data, it doesn't appear in the list so you can't just clear cookies. However! If you Clear All Data, it does get all sites somehow. Ugh - as I just did while entering this text. I think this specific feature needs some more testing. – TonyG – 2018-02-19T20:53:03.190

0

While not removing all the site data, this handy addon will remove the cookies for the current site:

https://addons.mozilla.org/firefox/addon/remove-site-cookies

yglodt

Posted 2010-08-07T17:33:06.007

Reputation: 211