10 Common Issues That Will Kill Your Episerver Website’s Load Time
If your website loads slowly then you will experience higher bounce rates, you'll get fewer return visitors, customers will complain and you'll end up losing revenue and potentially damage your company's reputation beyond repair... so having a good optimization strategy and testing your website is performant before you launch should be at the top of your priority list. Google now uses site speed as a rating factor in where your pages appear in its search results. In one study, it is estimated one in four people will leave your site if its page takes longer than four seconds to load. For these reasons, I would advise everyone planning a web project to schedule in a minimum of at least a week to think about performance, before they launch their new website. Having a good optimization plan should be a vital part of any new build and below lists the 10 most common errors that will cripple your pages load speed.
Too Many HTTP RequestsEach file that your web page needs, unsurprisingly, will require an HTTP request to fetch it. The maths behind this is easy.. the more files you link to in your web page the longer it will take to load. The more links your page contains the more bandwidth will be burnt processing it. In order to make your web page to load as quickly as possible, you will want to try and minimise the number of HTTP requests it makes. You can use the Giftofspeeds HTTP requests checker to see how many requests your pages make. HTTP Requests Checker There are a few common strategies to help with this:
- Combing Image Files: If your web page has a lot of images it will generate multiple server requests. To get around this, some images can be combined into a CSS/image sprite. An image sprite is a collection of images put into a single image. Using sprites will reduce the number of server requests and save bandwidth.
- Enable Keep-Alive connections: usually by default, a browser will only be allowed to perform one HTTP request per connection request. If you enable KeepAlive connections the browser will be able to send multiple HTTP requests over the same TCP connection.
- Limit The Amount Of Social Buttons: Plugins like 'Share This' produce an HTTP request for each social site that you use on your site.
Not Using Gzip CompressionBased on the findings from this video not enabling Gzip may mean your static HTML and CSS files may take up to an extra 70% in size! Enabling Gzip compression in your ASP.NET application means IIS will compress your website's files when they are being returned to the browser. Compressed files will reduce file size minimizing the time it takes to load a page. Adding Gzip is pretty easy. In your IIS site you should see a compression tab, click on it and enable it:
- Redirects to pages that redirect to other pages
- Do not use multiple redirects to more than source
- Redirects from domains that don’t really serve content, such as redirects from misspelled versions of your domain
404sAs a web developer, I'm hoping we all known what a 404 is. When a browser loads your web page, each web request will require an HTTP request. For every link in the page, like a stylesheet, the server will make a call to the server. Each unneeded request will waste your bandwidth and mean the server will be able to deal with less simultaneous requests. I personally like to use Xenu's Link Sleuth . Xenu is a free Windows desktop app. You point it at your domain and it will spider the entire site and create a report based on all the 404's it comes across. For an alternative online source you can also use W3C’s link checker W3C’s link checker
Not Using Browser CachingAgain, I'm hoping everyone know what caching is... one thing that is very easy to forget to do, however, is to update your web.config to enable browser caching on your static web files. All websites are composed of a certain amount of static components, such as images, stylesheets, scripts etc... that rarely change. Instead of having your visitors continually download these files on each page request, you can cache them on the user side. This caching means less bandwidth on your server and the page load time will also improve. If you are using IIS7 & and you want to cache static content, add the following in the web.config:
<staticContent> <clientCache httpExpires="Sun, 27 Sep 2015 00:00:00 GMT" cacheControlMode="UseExpires" /> </staticContent>