Connect with us
Speeding Up Wordpress - Avoid Landing Page Redirects Speeding Up Wordpress - Avoid Landing Page Redirects

URL Redirects

Speeding Up WordPress – Avoid Landing Page Redirects

Published

on

Redirects are what takes your visitors from one location or file to another one and, done in several ways, they can seriously affect your page loading speed. How? Because time is being wasted loading one page only to be sent on to another one.

As mobile usage becomes more and more prevalent, these redirects are going to become more of an issue and if you have implemented some kind of mobile SEO solution, you need to go look at the redirects closely. Mobile users are more affected because they don’t tend to have such a good internet connection.

Some redirects may be useful but, no matter what they are, they do cause significant issues with page speed and performance. Each one that you can remove, or at least clean up, will have a positive effect on speed.

Avoid Redirects

If you have no redirects on your website, then you should be serving up your content considerably faster. Redirects are an incredibly waste of time, especially if you take your mobile visitors into account.

There are two types of redirect:

Server-Side – fast and cacheable

These commonly show up as 301 or 302 redirects; HTTP is used to tell a visitor that a resource or a page has been moved. 301 is permanent, 302 is temporary. Server-side means that the web browser is doing the work of redirect and can handle it a good deal quicker than client-side requests. The browser can also cache the new file location.

Client-Side – slow and not cacheable

These tend to use the HTTP equivalent of the ‘refresh’ attribute or they use JavaScript, and both are incredibly slow, affect performance and should be avoided at all costs.

Most websites will have redirects on them; the most common is 301, redirecting from a non-www to a www version of a website and, as these have long been recommended for SEO purposes, many websites use them. If you have 301 redirects, keep them as they help the search engines to read and understand your website.

Recommendations

Google, the largest search engine in the world, recommend that you remove any redirect that is unnecessary. They say you should never:

  • Link to any page that you know has a redirect on it. This will happen when you create a manual redirect but don’t edit the HTML text link, so it points to the right place
  • Need any more than one redirect to get to a resource

We mustn’t forget that HTML is not the only thing our web pages load. You might think that you have no redirects but don’t forget about external scripts, CSS files or images.

You can use Google Page Speed to work out what your page calls as it loads so check to make sure that none of them are creating redirects. For example, if your site is a www site, check that you are using www to call your files and other resources.

Checking for Old Redirects

Have a look in your .htaccess file or in any other server configuration file to make sure there are no old redirects still hanging around. These might have been added for specific pages or sections of the site and, if not removed when no longer needed, server to clog your website up. In particular, look for the redirects to content that no longer exists.

Removing Redirects

There is a kind of best practice guide to work through when you are removing redirects:

  • Find them
  • Know why they are there
  • Check to see if and how it affects other redirects or is affected by another redirect
  • Remove the redirect if not required
  • Update the redirect if needed

Cleaning Redirect Chains

More often than removing redirects, you will probably need to clean up redirect chains. For example, you have put a site-wide redirect on to redirect from a non-www site to a www version of it.

Then, later, you move to an https version and redirect once more. You need to make sure the redirect is not going from non-www to www to https. What it should be is non-www straight to https.

As well as checking for individual redirects that are no longer required, check your chains for extra redirects – all these do is add an extra step in that just slows things down even more.

Click to comment

Featured

Serve Resources from Consistent URLs

Published

on

consistent urls

No doubt, if you use a tool like GTMetrix, you’ve seen a warning telling you to serve your resources from consistent URLs. The warning will tell you that the resources listed have got identical content in them but are not being served from the same URLs.

Serving from consistent URLs not only saves resources and time on fewer requests, it can also save in bandwidth.

Why Does This Happen?

All websites use resources like JS files, CSS files, images and so on to deliver the right layout, the right functionality and a better user experience. Every resource is individually called by a browser when the webpage is accessed, and these are called HTTP requests.

Most of the time, each of the resources are served from one URL but, on occasion, a resource may be available through several domains or hostnames. That means that, when that page is loaded, it gets called several times and downloaded several times, once from each URL. This causes slower page loading.

This tends to happen when a resource is shared between multiple sub-directories or sub-domains on the same website or, sometimes when multiple plugins use the same eternal resources or libraries.

In short, it is down to redirects that have not been properly implemented, the wrong settings in your CDN or even a bug inside the theme you use. This all results in multiple HTTP requests, multiple downloads and even multiple DNS lookups, all of which have a negative effect on SEO and on page speed.

How Do You Serve Resources from Consistent URLs?

The four main situations that result in duplicate resources are:

  • When there is an HTTP and an HTTPS version of a website
  • When two websites share the same resources
  • When two or more plugins are sharing resources
  • When a CDN hosts resources and those resources can be accessed through the origin server and the CDN

And the methods to solve this issue are:

Move

The commonest issue is resources shared between several linked sites or subdomains. The solution is for the filename to be served from one hostname and linked to from the other. Although an extra DNS lookup is needed, the benefits reaped from caching make it worthwhile.

Rewrite

When you use a CDN for speeding up your website, you may get duplicate resources usually caused by the way that your plugins or theme handle the static resources. Normally you would edit the URLs for the static resources manually or through a plugin, thus moving them to the CDN.

Most of the time, this goes smoothly but sometimes a plugin or theme will pull some of the files out of the media library, into the code. The solution is to go into your theme’s files and change the path so that it points to the CDN file.

Doing it manually is not the best way; instead, go into the header.php file and find the line that defines the path the content, usually a logo, and edit it so it matches the CDN resource.

Redirect

If your website is available at two different addresses, such as mysite.com and www.mysitecom, you may end up with duplicate resources. Although you might have a good reason for having your website constructed in this way, you do end up with two websites.

One is hosted on the domain root and the other on the subdomain. The solution is to choose the main website and use 301 redirects sitewide. This will tell browsers and search engines to forget the other versions and go straight to the main site.

Canonical Tag

You can also use canonical tags to consolidate resources, useful for e-commerce sites where multiple pages may point to a single resource using different attributes or categories. In all honesty, a canonical tag shouldn’t be your first choice if you can use redirects instead. Rather than removing duplicate resources, canonicals just tell a search engine to prefer a specific version of your content

To implement a canonical tag, add the link to the resource you want into the code of the duplicate resource using the canonical attribute of rel=.

Plugins

Sometimes the issues will be caused by several plugins trying to share a resource or one plugin adding a string, like ?dshd=343, for example, to the original URL. The best way to solve this is to deactivate one or more plugins.

You can’t control a plugin because it is a third-party product so all you can do is deactivate. To see which one/s need to be deactivated, turn the settings off for each one and then on again to see which cause the problem.

Whichever solution works for you will result in your website speed increasing and fewer resources being used.

Continue Reading

Categories

Archives

Digital Marketing Job Board

Trending