Understanding why pages load slowly

Although we may build a great site that works well across multiple devices, it's still no good if it is slow! Every website will of course operate differently, but there are a number of factors to allow for, which can affect page (and site) speed:

  • Downloading data unnecessarily: On a responsive site, we may hide elements that are not displayed on smaller devices; the use of display: none in code means that we still download content, even though we're not showing it on screen, resulting in slower sites and higher bandwidth usage.
  • Downloading images before shrinking them: If we have not optimized our site with properly sized images, then we may end up downloading images that are larger than necessary on a mobile device. We can of course make them fluid by using percentage-based size values, but if the original image is still too large, this places extra demand on the server and browser to resize them.
  • A complicated DOM in use on the site: When creating a responsive site, we have to add in a layer of extra code to manage different devices; this makes the DOM more complicated and slows our site down. It is, therefore, imperative that we don't add any any unnecessary elements that require additional parsing time by the browser.
  • Downloading media or feeds from external sources: It goes without saying that these are not under our control; if our site is dependent on them, then the speed of our site will be affected if these external sources fail.
  • Use of Flash: Sites that rely heavy on using Flash will clearly be slower to access than those that don't use the technology. It is worth considering if our site really needs to use it; recent changes by Adobe mean that Flash as a technology is being retired in favor of animation using other means such as HTML5 Canvas or WebGL.

There is one other point to consider, which we've not covered in this list; the average size of a page has significantly increased since the dawn of the Internet in the mid-nineties. Although these figures may not be 100% accurate, they still give a stark impression of how things have changed:

  • 1995: At that time, the average page size used to be around 14.1 KB. The reason for it can be that it contained around two or three embedded objects such as images. That meant just two or three calls to the server on which the website was hosted.
  • 2008: The average page size increased to around 498 KB in size, with an average use of around 70 objects that includes changes to CSS, images, and JavaScript. Although this is tempered with the increased availability of broadband, not everyone can afford fast access, so we will lose customers if our site is slow to load.

All is not lost though—there are some tricks we can use to help optimize the performance of our sites. Many of these apply equally to standard sites as well as responsive ones—let's take a look in more detail.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset