Live data from Hacker News

Tangled issues with permanent HTTP redirects

utcc.utoronto.ca

1–10 of 15 posts

Re: Tangled issues with permanent HTTP redirects

#5
This short essay is good philosophy, but doesn't seem very connected with reality. No, search engines and browsers don't permanently cache permanent redirects. Yes, you should probably use unique usernames instead of reusing them. The second fully mitigates the first, for this particular situation.

Re: Tangled issues with permanent HTTP redirects

#6

If it's not permanent then just keep it temporary... I don't see the problem here

Part of the problem is the belief that a 301 is the best option for SEO because it passes 'link juice'.

Evidence for this being true will always be some random blog post from a self proclaimed expert.

My default option is always a 302 for the simple fact that it isn't going to be cached and can be easily changed with no ill effects. I've yet to notice any disadvantage from an seo point of view.

Re: Tangled issues with permanent HTTP redirects

#8
There seems to be some FUD going on here. The solution to the OP problem is simply to use 301 redirects with Cache-Control headers to limit caching to some reasonably short duration.

It is true that browsers will cache 301 redirects eternally, but only if the server does not supply cache directives to indicate otherwise. For this reason, it is always advisable to include some cache directives in 301 redirect responses, like `Cache-Control: max-age=86400`. I'm surprised that this isn't more universally acknowledged as an important practice.

As far as search engines, there will not be a problem if a URL that used to return a 301 now returns a 200. The web changes, and search engines know that very well.

Add: There also seems to be a lot of confusion about the meaning of permanent. Permanent should not be taken to mean eternal. If I move to a new house, I consider that a permanent move, because I no longer live at the old address. But it would be unreasonable to assume that I will never move again. I might even move back to the original house! Such moves are like permanent redirects; I might have my mail forwarded, but it is not an indelible, eternal change. Temporary redirects (302, 303, 307) are more like leaving a sticky note on the door while you're out running an errand; you have not permanently relocated.

Re: Tangled issues with permanent HTTP redirects

#9
post #5

This short essay is good philosophy, but doesn't seem very connected with reality. No, search engines and browsers don't permanently cache permanent redirects. Yes, you should probably use unique usernames instead of reusing them. The second fully mitigates the first, for this particular situation.

From some quick googling, everything I can find claims that browsers permanently cache permanent redirects. The MDN also says that a 301 causes search engines to update the link in their index.

Don't just make claims, support them. Link to anything which demonstrates that permanent redirects aren't cached permanently.

Re: Tangled issues with permanent HTTP redirects

#10
post #4

If it's not permanent then just keep it temporary... I don't see the problem here

The problem is that perfectly distinguishing permanent and temporary redirects requires infallible knowledge of the future, which is not possible.

"permanent" redirects are practically never treated as permanent, though... They are just treated as more permanent
Post reply on HN