Redirects - Page Speed Best Practices
Following redirects can significantly slow down network requests so you should avoid using page and resource URLs that trigger redirects.
Redirects trigger an additional HTTP request-response cycle and delay page rendering. In the best case, each redirect will add a single roundtrip (HTTP request-response), and in the worst it may result in multiple additional roundtrips to perform the DNS lookup, TCP handshake, and TLS negotiation in addition to the additional HTTP request-response cycle. As a result, you should minimize use of redirects to improve site performance.
Avoid internal link redirects
To speed up browsing between pages on your site, avoid hyperlinks to URLs that perform redirects. For example, say you had a hyperlink pointing to /news
which now redirects to /updates
because the page was moved. A user visiting the hyperlink would experience a significant page loading delay as the redirect was being followed. You can avoid delays like this by hyperlinking directly to the redirect destination.
Learn more
- Redirects - Best Practices for Speeding Up Your Web Sitedeveloper.yahoo.com
- Avoid Landing Page Redirectsdevelopers.google.com
Avoid resource redirects
Avoid loading page resources via URLs that perform redirects as redirects will slow down page loading. For example, if a CSS file was loaded using the URL example.com/styles.css
that then redirects to www.example.com/styles.css
, the redirect would introduce a delay when the file was fetched. This can be fixed by linking directly to the redirect destination.
Learn more
- Redirects - Best Practices for Speeding Up Your Web Sitedeveloper.yahoo.com
Avoid redirect chains
When a redirect must be used, use a single redirect instead of a chain of several redirects for a faster response. For instance, a redirect chain such as http://example.com
β https://example.com
β https://www.example.com
can be common when redirect rules havenβt been optimised. Chains of redirects add significant delays to fetching URLs while browsing and search bots may give up following long chains which can impact search rankings. You should optimise your server redirection rules to eliminate chains of redirects when it isnβt possible to eliminate redirects entirely.
Learn more
- Can too many redirects from a single URL have a negative effect on crawling?www.youtube.com
- Is there a limit to how many 301 (Permanent) redirects I can do on a site?www.youtube.com
- Avoid Landing Page Redirectsdevelopers.google.com
More articles in this series
β This article is from our comprehensive Page Speed Best Practices guide.
β Previous article in this series: Javascript