: Which is longer cached by SE robots or browsers, redirect 301 or 302 I have looked on Stack Exchange but didn't find the solution for my problem. The problem: I have a website and want to
I have looked on Stack Exchange but didn't find the solution for my problem.
The problem: I have a website and want to become an SEO hero. So, I also need to choose status codes...
I know that there are approximately 2 status codes to trigger a redirect.
301 - Moved Permanently
302 - Moved Temporarily
The question: Which status code stays longer in the cache and how long would that be approximately?
More posts by @Hamaas447
1 Comments
Sorted by latest first Latest Oldest Best
there are approximately 2 status codes to trigger a redirect
More like 5 ... 301, 302, 303, 307 and 308.
See: en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection
302 - Moved Temporarily
A 302 should never be cached. Browsers do not ordinarily cache a 302. It is after all "temporary".
301 - Moved Permanently
301s are cached by default. Since this is considered a "permanent" redirect, browsers (and possibly intermediary caches) will cache a 301 "aggressively". Without additional cache control headers there is no clear rule for how long the redirect should be cached - it's browser/cache dependent. But suffice to say, it can be a "long time".
However, you should be able to send the appropriate cache control headers (ie. Cache-Control/max-age and Expires HTTP response headers) with the redirect in order to control the caching behaviour.
Reference: stackoverflow.com/questions/9130422/how-long-do-browsers-cache-http-301s
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.