Speed Minimize Redirects

a redirect

Redirects are instructions or methods that automatically take visitors of one file to another file or location. They are accomplished in many ways. Each way hurts your pagespeed.

How do redirects affect page speed?

Have you ever asked where a bathroom is and then you go there, and are told that this bathroom is closed and you have to go to some other bathroom? It is like that. Redirects cause your pages to load slower because it is a waste of time to go to one place just to be redirected to another.

There are many good and legitimate reasons to have redirects but it should be kept in mind that redirects cause significant performance and speed issues.

Avoid redirects

If you do not use any redirects, you are serving your content significantly faster. Redirects are likely the one single most time waster in your code especially when you consider mobile networks. They dramatically affect your page speed in a noticeably bad way.

Server-side redirects: Fast, cachable

Common redirects are 301 and 302 redirects which use HTTP to explain that a page or resource has moved. A 301 redirect is permanent and a 302 redirect is temporary. These are both server-side redirects which means that the web server is using HTTP to direct the browser to the new location of the file. Web browser can handle these types of redirect much quicker than client-side redirects and can cache the correct location of the file.

Client-side redirects: Slow, not cachable

Redirects that use the http-equiv="refresh" attribute or javascript can introduce even longer waiting times and performance issues and should be not used if at all possible.

Got redirects?

You very likely do have some. Perhaps one of the most used redirects on the web is 301 redirect site wide from the non-www to www version of a webpage. These types of redirects have been recommended for SEO reasons for years so many people have them.

It is my recommendation that if you have this type of redirect, you keep it in as it helps Google understand your website better.

You can check for redirects on your pages by using the seo tool here, which detects and displays 301 and 302 redirects.

It is a good time to check all your pages redirects and see where they are on your site and think about how to change them, or if they are important enough to slow down your pages. Google suggests eliminating redirects which are not absolutely necessary. Google suggests eliminating them by...

Don't forget that your webpage isn't just loading HTML

Virtually all webpages require other things to load. You may think you have no redirects in your HTML, but what about your CSS files, images or external scripts? Make sure you know what resources your page is calling as it loads. Use the request checker tool to do so.

Patrick Sextonby Patrick Sexton