Is it possible to clear only 301-redirects from Firefox's cache? CTRL+F5 doesn't do the job since you just reload the target without caching but do not clear the cached redirect.

An option to disable caching of those redirects completely would be fine, too - but some way (possibly through an extension) to remove those cached redirects would be better.

Note: I'm not looking for answers that disable all caching (including CSS, JS, etc.)

  • Use 302 or 307 if you want to redirect temporarily... 301 is for permanent redirection... – inf3rno Dec 7 '13 at 8:56
  • 2
    I know that. But sometimes you forget to change that or your framework uses one (for example, Flask does so when redirecting from /foo to /foo/) – ThiefMaster Dec 7 '13 at 12:02
  • 1
    Hmm most of the frameworks turn off cache by debug mode, or you can turn it off manually if you add no-cache, no-store headers. That will prevent cache by 301 headers too, if I am right. If it was cached recently, you can clear the recent cache by history/clear recent history. If it was not recent, you can find the site in the history, click on it with the right button and choose delete this page or forget about this site. Theoretically all of these are working, in practice I never used them to remove a redirection from the cache... – inf3rno Dec 7 '13 at 18:17
  • 1
    FYI - 302 gets cached as well – dsmtoday Jan 16 '16 at 1:36
  • 1
    "This response is only cacheable if indicated by a Cache-Control or Expires header field." - so unlike 301 it shouldn't be cached all the time – ThiefMaster Jan 16 '16 at 1:42

Locate the site you are redirected from in the History sidebar. Right-click it and select "Forget about this site".

No addons required!

P.S. I'm pretty sure this didn't work in the past, but nowadays following the redirect and then clearing the cache for past hour will actually remove the cached redirect.

  • 17
    Works for me too. Make sure you delete the history entry of the site you're being redirected from, not the site you're redirected to. – marcvangend Oct 7 '14 at 9:22
  • 14
    Confirmed on Firefox 41. But note: "Forget about this site" will forget the cached pages, URL history (needed for auto-completion) and even saved passwords for the whole domain. It says "site", not "page", and this feature seems intended to protect your surf history privacy. It might not be what you want here, so be careful. – tanius Oct 9 '15 at 21:01
  • 1
    working perfectly – h3nr1ke Oct 12 '15 at 13:30
  • 2
    Works in Firefox 50. The end of many hours of frustration. – Andy Gee Nov 29 '16 at 7:21
  • 1
    BEWARE! Based on my experience with FF so far (from version 40-something up to the nightly build from Apr. 13), this clears ALL entries (for ALL domains) 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! – Janaka Bandara Apr 17 at 14:23

Here is the simple solution for this in Firefox:

Menu -> Tools -> Options -> Advanced -> Network -> Clear Now

and it's done.

  • 2
    Nice! Unlike my solution, this works even if your only visit to the site is a redirect to an error page, because those don't appear in the history and you have nothing to click "Forget about this site" on. – RomanSt Aug 14 '14 at 16:31
  • 1
    the only problem with this solution is that it doesn't clear only 301-redirect as the OP would like. – Loopo Dec 23 '14 at 15:00

The only solution I've found so far - short of clearing the whole cache - is the "Disable entire cache" toggle in Web Developer Toolbar. Once disabled you hard reload the page and you get the new version (remember to uncheck the toggle after you're done).

  • I see a "Disable DNS cache" option, and that seems to do what I want. Very annoying this caching! Thanks for the tip. – SPRBRN Apr 24 '13 at 13:58
  • Additionally to "Disable entire cache" I had to select "Check For Newer Version Of Page Every Time" for the redirect cache to be forgotten. This is the only solution that worked for me on Firefox 35.0.1. – user194149 Feb 4 '15 at 11:50
  • this was the only thing that worked for me FF 59.0 - resending the request did not clear it & clearing more caches was not an option – RozzA Mar 12 '17 at 23:57
  • Somewhat obvious, but this checkbox is in the 'network' tab in the developer toolbar. It's now just called 'disable cache'. I like this because it doesn't wipe all info about the site from the cache. – Jahmic Apr 25 at 8:03

The quickest way to remove the cache in Firefox, which includes 301 redirects, is the following:

  • Press CTRL + SHIFT + Delete
  • Change the time range, if needed
  • Click on Details and uncheck everything other than "cache"
  • This actually works fine, no need to downvote. – Simon A. Eugster Jul 19 '16 at 6:51
  • This is somehow overkill since it deletes at least the last our of activity, but may be useful. – Stéphane Gourichon Sep 30 '16 at 10:24
  • Better to loose the last hour than the whole history, saved passwords etc... Thanks – dario Dec 13 '17 at 18:02

Another solution is;

  • Open the Developer toolbar on the Network tab (Ctrl+Shift+Q or Cmd+Opt+Q)
  • Ensure the "All" or "HTML" filter is enabled on the bottom row
  • Navigate to the URL you're receiving a cached redirect on, as usual
  • Notice the first HTML request will show a 301 in the Network list
  • Right-click that row, choose "Edit and Resend"
  • A pane will display on the right, allowing you to edit the HTTP request. Just click "Send"
  • A new HTML request will show in the Network list, this time (hopefully!) returning a 200
  • Navigate to the URL again, it should work as expected
  • Thanks, this is a good scalpel-y way that works for pages that return an error (and thus don't show in history). – cincodenada Apr 8 '16 at 0:46
  • 1
    This answer looks complicated, but to me it is the only one that actually answer the OP's question: remove only the 301-redirect cache. – Stéphane Gourichon Sep 30 '16 at 10:28
  • This does not work with FF 59.0.1, or at least with some requests. Clicking "Send" does nothing. Not sure whether bugzilla.mozilla.org/show_bug.cgi?id=1151932 is related, but it discusses similar symptoms. – Richlv May 2 at 19:04

Late answer. With Firefox 50.

  1. Open up Web Developer in Firefox (F12)
  2. Open up Toolbox Options (Gear/Cog shape icon on top of Web Developer window)
  3. Under Advanced Settings, check the box Disable HTTP Cache (when toolbox is open).

With Web Developer windows opened, redirect cache will be refreshed.

  • I'm quite sure this disables the whole cache altogether, making reloads of a large application with lots of JS/CSS files - even when running locally - awfully slow. – ThiefMaster Jan 1 '17 at 12:00
  • It's a solution to clear your redirect cache frustration ( almost no way good way to clear it, i disabled history on my browser, other answers above don't solve my problem :( ). Then either close the Web Developer (F12) or uncheck the options then you can continue on development. :) – checksum Jan 1 '17 at 12:06

If you are on windows, and the url is not shown in the browser history

Use a search tool like wingrep or the option "Find in files..." in Notepad++ to search for files under this path:

C:\Users\<user>\AppData\Local\Mozilla\Firefox\...

Search for files that contains both the exact text: Moved Permanently, and the URL that are redirecting.

The search might take a minute, and might return more than one file.

Then simply delete the file(s) found, and restart Firefox.

  • Which is even more of a hassle than just clearing the cache considering your solutions needs a browser restart... – ThiefMaster Oct 3 '16 at 7:28
  • 1
    Your question was: "Is it possible to clear only 301-redirects from Firefox's cache?" ... – User0 Oct 3 '16 at 17:42

You can clear cached redirects as a part of browsing history, selecting a time range. For the recent Firefox Quantum 57.0.3, here's how to do it:

  1. Click the hamburger menu or the library button next to the search bar.
  2. Click 'History'.
  3. Click 'Clear Recent History...'.
  4. Expand 'Details' clicking a small button next to the label.
  5. Uncheck all but 'Cache'. Optionally: select the preferred 'Time range to clear'.
  6. Click 'Clear Now'.

For earlier versions of Firefox, see @mihkov's comment on the question.

  • Welcome to Super User! It's good to link to the comment you used for reference, but it's even better to add the context in the answer itself, to make the answer self-contained. That way, someone looking at your answer does not have to read the comment thread first. – jpaugh Jan 11 at 19:53

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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