Loading Jaywing website
28 February 2019 / Opinion

Do modern browsers still cache 301 redirects?

Malcolm Slade / Director of SEO

Tldr:

Tested 301 redirect caching 02/2019 using Chrome 72, Firefox 65, UC Browser 7, Chromium 41 (for no real reason other than I had it installed!), latest version of Chrome on Android, latest version of Safari on iPhone, IE11 and Edge.

None of the browsers cached the 301s!

/Tldr.

Things change all of the time; a lot of content on the internet is old and what we think we know from past experience may well become outdated quite quickly. This is why publish dates are important and us SEOs test and retest stuff over time.

Over the last 13 years, I’ve carried out A LOT of site migrations and as part of this, written many redirects. I’m very risk averse and would usually add headers to my redirects to prevent browsers caching them so that if a client needed to rollback a migration, they could without messing with a percentage of their users.

I don’t recall the last time I tested this, but I do recall that Chrome used to cache redirects indefinitely and I think IE did as well, meaning I would have to do a lot of manual purging etc. during testing periods.

I’ve been working on some pretty unique migrations recently, one at the moment involves moving the site back to an old domain after a decent amount of time, so my internal alarms went off!

We redirected X to Y and now we need to stop this and redirect Y back to X. Surely all of the users since the initial migration will have cached the 301s and will get stuck in an infinite loop resulting in some dire message and frustration?

I did a bit of Googling and views were mixed (shock horror!) so I decided to test it myself.

The testing

It was pretty basic:

  1. Setup 2 pages
  2. Browse to page 1
  3. Setup redirect from page 1 to page 2
  4. Browse to page 1
  5. Setup redirect from page 2 to page 1
  6. Browse to page 1
  7. Browse to page 2
  8. Remove redirect from page 1 to page 2
  9. Browse to page 1
  10. Browse to page 2
  11. Setup 2 more pages
  12. Repeat steps 2 to 11

The results were consistently boring:

  • Test 4 always resulted in a redirect
  • Test 6 always resulted in a redirect loop
  • Test 7 always resulted in a redirect loop
  • Test 9 always resulted in page 1 loading
  • Test 10 always resulted in a redirect

I had planned to go further and end sessions etc. to see if caches were purged, but based on the results it wasn’t necessary.

So, I’m pretty sure the latest versions of all the browsers don’t cache redirects any more.

The Chromium 41 results make me think it might have been this way for a while and any browsers built on Chromium like Opera should perform the same.

Conclusions

I haven’t given much thought to how Google will react to a reversal of redirects. Old me (yes, I appreciate I am old me, but you know what I mean) thinks that this kind of thing (non-permanent 301 redirects) is very common and Google has to deal with it.

Google simply reapplies all the old equity to the original URLs and any gained by the new URLs is forwarded on by the new redirects.

Current me, based on comments by Googler’s, thinks that all of the equity gained by the original URLs might have been already permanently transferred to the new URLs, meaning if I didn’t apply new 301 redirects, the original URLs would be starting fresh.

Either way, it doesn’t really matter as long as one of those two is correct. I guess we will see.

I would be glad to hear any alternate perspectives, experiences etc. on this if you have any.