Firefox 5 'caching' 301 redirects
I have found a solution for this that works on Firefox 26, after having an obsolete redirect cached for over a month and a restart.
- On the History menu, choose Show All History.
- In the search, type in the domain with the cached redirect issue to bring up a list of results.
- Right-click on one of them and choose "Forget about this site".
All cached pages, images and redirects for only that site will be removed from the cache. This lets you clear the redirect for your development website without clearing the rest of your cache.
As a side note, I think Firefox should only cache redirects for a few days at most. Caching them for over a month can make a simple mistake a big problem.
I just experienced this problem, and for me it was two issues.
This particular domain name is routed through Cloudflare, so I had to set it to development mode. I think Cloudflare was caching the 301 redirect so it didn't have to send the request to the server. This step might not apply to you obviously.
Then, I simply cleared my Firefox cache (version 11) by going to Tools -> Options, clicking the Advanced button at the upper right, selecting the Network tab, and then clicking Clear Now under the section Cached Web Content. Note my cache was already set to 0, but I still needed to click the Clear Now button to get the redirect to stop being cached.
I'd be interested to know if anyone else can verify this.
In Firefox you have the "Web Developer" Tools (Ctrl+Shift+I). You can click "Network" tab and check the checkbox "Disable Cache" to check for new version of page every time. Then load the original URL and it will refresh your cache. Then you can enable the cache again and access that URL also from other tabs. So you don't need to clear your full cache.
From cptstubing06's comment, the following can help clear the cache:
- Type Ctrl+l to put the cursor on the location bar.
- Type
about:config
to open the configuration settings. - Confirm any warnings.
- Type
browser.cache
followed by Enter to filter the settings. - Double-click
browser.cache.check_doc_frequency
. - Change the value from
3
to1
. - Click
OK
. - Revisit the obsessively cached 301 page.
- Reset the frequency back to 3 when finished.
Firefox should now redirect to the new 301 page, no longer fetching the redirected page from cache.
301 is just a normal cacheable response code. http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.2 says:
This response is cacheable unless indicated otherwise.
So if you don't want it cached, your server needs to indicate otherwise through the normal headers used to control cache behavior.
You can also clear the cache manually.