How can I make Chrome stop caching redirects?
Solution 1:
Google Chrome will cache your 301 redirects. To get around this, and to keep the tabs open, you'll just need to clear your browser cache.
Chrome Menu > Settings > Show advanced settings... > Privacy > Click Clear browsing data...
Whatever else you select, make sure "Cached images and files" is a checked option.
Then click Clear browsing data and you should be able to retest again.
If you've just followed the redirect, you only need to delete data from the past hour.
Alternatively, test and develop in incognito mode. There the cache is flushed after the browser is closed.
Solution 2:
This is the sure proof way to clear Chrome's sticky memory for redirects without clearing all your browsing data (method used by the current top answer):
-
Open the Developer Tools panel (optioncommandi on Mac, or ctrlshifti on Windows)
-
Click and hold the reload icon
-
A menu will open
-
Choose the 3rd option from this menu ("Empty Cache and Hard Reload")
Here's an excellent explanation of how these 3 options differ.
PS: To avoid having to do these steps everytime the redirect is followed by Chrome: check disable cache in DevTools, and while DevTools is open Chrome will bypass the redirect cache (per this answer)
Solution 3:
It's not a perfect solution, but I was able to prevent Chrome from using the cached redirect by passing a bogus query string, or adding a bogus parameter to the existing query string. For example, adding a simple ?
to the end of a URL that didn't have q query string worked for me on Chrome 30 on Max OS X.