339

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?

Hennes
  • 64,768
  • 7
  • 111
  • 168
Ryan C. Thompson
  • 11,563
  • 9
  • 47
  • 69
  • 2
    When 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 Dec 04 '15 at 09:55

15 Answers15

322
  1. Select the Firefox Menu button (three horizontal lines on the right).
  2. Select Library.
  3. Select History.
  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
  • 3,673
  • 1
  • 18
  • 21
  • Looks like we have a winner! I guess this was added somewhat recently? – Ryan C. Thompson Mar 25 '14 at 17:17
  • 6
    You're still here! Three and a half years later. :) To answer you: yep, "yesterday". Thanks for the kudos. – zylstra Mar 26 '14 at 18:52
  • Great answer, but just made Firefox crash :) – Nick Jul 05 '14 at 02:04
  • 6
    This 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 Sep 04 '14 at 14:35
  • 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 Oct 14 '14 at 14:57
  • 17
    A 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. – Gabriel Jan 30 '15 at 16:03
  • @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 May 29 '15 at 19:18
  • 4
    Also, 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 Jul 03 '15 at 12:41
  • @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. – Dr. Hans-Peter Störr Sep 29 '15 at 06:31
  • 8
    The question was to delete the site from the browser cache, and not from the history. This answer is bad. – peterh Nov 22 '16 at 11:00
  • @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 Nov 24 '16 at 18:49
  • 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](http://superuser.com/questions/488966/cache-cant-be-cleared-for-a-specific-site-in-firefox?rq=1). – peterh Nov 24 '16 at 22:01
  • 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 Aug 25 '17 at 18:15
  • 1
    @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 Nov 10 '17 at 09:35
  • What's vhosts, and can it be used with Visual Studio on Windows? – Joshua Frank Nov 11 '17 at 11:59
  • 9 years ... 9 years and this is still broken in FF. 9 years and Ctrl-F5 still isn't implemented properly (doesn't work for redirects). 9 years and you still only have the choice "lose everything" or "can't use the web". Sob. – Adam Mar 09 '20 at 15:29
  • 2
    In current Firefoxes, just press `Ctrl + Shift + H` to open the `Library`. – Dmitriy Popov Jul 10 '20 at 13:44
45

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
  • 14,432
  • 9
  • 56
  • 76
8

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
  • 335
  • 3
  • 10
  • 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 Apr 27 '14 at 07:13
  • 1
    I 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 Jul 24 '15 at 07:13
  • 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 Jul 24 '15 at 13:12
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
  • 8,400
  • 4
  • 28
  • 41
5

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
  • 1,869
  • 21
  • 15
3

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
  • 193
  • 6
  • 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 Feb 19 '18 at 20:53
  • Thanks. Works perfectly. – Dani-Br Aug 15 '22 at 14:23
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
  • 2,474
  • 5
  • 27
  • 38
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.

Synetech
  • 68,243
  • 36
  • 223
  • 356
Sol
  • 31
  • 1
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
  • 11
  • 1
1

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
  • 1,228
  • 3
  • 14
  • 26
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
  • 157
  • 6
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).

phuclv
  • 26,555
  • 15
  • 113
  • 235
Janaka Bandara
  • 280
  • 1
  • 2
  • 13
  • 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 Apr 01 '18 at 10:47
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
  • 251
  • 3
  • 9
0

Clear Browsing Data is a recommended Firefox extension which enables you to delete browsing data, such as cookies, history and cache, directly from the browser toolbar. The toolbar button can be configured to clear all browsing data with a single click, or to show a list of data types available for clearing.

Supported data types:

Cookies
Browsing history
Cached images and files
Autofill form data
Download history
Service Workers
Plugin data
Saved passwords
IndexedDB data
Local storage data
Abdul Rauf
  • 139
  • 1
  • 2
  • 10
-1

just open the same page in a firefox "private window" should work to refresh cache for that session and pull new page

brian
  • 1