ArtsAutosBooksBusinessEducationEntertainmentFamilyFashionFoodGamesGenderHealthHolidaysHomeHubPagesPersonal FinancePetsPoliticsReligionSportsTechnologyTravel

Speed up page load times

Updated on December 2, 2012

Improving Page Load Times

Today Google is paying attention to page load times when it ranks a website. What this means to a website owner is if your page takes longer to load than another website’s page carrying identical ( or almost the same ) page content, Google will rank your website lower in its index that the other website. 

This in turn means you website page will be served later in Google’s search engine results page than all other website’s whose pages carrying identical or very similar content.

This can have a pretty large impact on the earnings you could be making via your website.  If other website pages are being served in Google’s SERPs first their page adverts or their affiliate links are being clicked on and possibility that they earn via their adverts or affiliate links will be higher than yours.

There can be any number of reasons why your website page loads more slowly than others.  In this material we are going to take a look specifically at how having multiple images in a web page effects it’s page load time.  There seems to be a simple rule of thumb here, the greater the number of images in a web page the longer the page will take to load.

This simple rule has a coloration as well:

1)   Image size – i.e. the larger the image size the worse its effect on the page load time.

Hence if a webpage contains a large number of large sized images its page load time will be pathetic when compared to a webpage that delivers the same content ( or similar content ) without the large number of images, or without the large number of large images.

Well there’s the question: How does a webpage without images look good?  Strangely site visitors are not too happy with web pages that only deliver textual content, i.e. Textual content without images. While such web pages be really informative to the site visitor, the site visitor will find then bland and most likely move away to another website.

Again, this will have a direct impact on what you can earn via your website.

Okay so what’s the best compromise? What if there’s a way of having multiple images on a web page and have that page load swiftly?  That would be like having a piece of cake and eating it too.  Here’s an approach that should help you achieve this.

Once you’ve decided on the minimum number of images you simply must have on a specific web page so that it looks attractive enough to keep a site visitor reading and not navigate away, use one of the many free image compression tools available on the Internet, to compress these images. 

Image Size

These tools normally compress images with the very minimum loss of visual appeal ( or no loss at all ). Pretty amazing. One such tool is Smush.it by the Yahoo developer network.  It’s completely free to use, pretty simple to use, you just cannot go wrong  It also tells you exactly how much of the image’s size you’ve shaved off by compressing the image using Smush.it.

I’ve written a step-by-step Hub on how to do just this, do take a look.

Parallelized downloads across hostnames

Once you’ve compressed your images fully focus on delivering these images from another host.  You can actually deliver your images from a secondary website either hosted on another Web server or stored within as a Sub-domain under your current website.  Both approaches seem to work pretty well.

Let’s take the Sub-domain approach first. Using this approach will cost you nothing.  Using cPanel create a sub-domain for your current domain and allot some disk space to it. The Sub-domain will have a name like subdomainname.www.domainname.com.

Create a folder in this Sub-domain and copy all the compressed images to this folder.

Next using Page speed, or some similar page load speed tool check the load time of the specific page whose load time you are trying to speed up.  This will be the Datum page speed value, against which the new page speed value can be checked to establish whether there has been a reduction in page load speed or not.

If this cannot be checked then the entire exercise of attempting to speed up a web page load time is basically futile.

Once you have the Datum page speed load factor noted, then open the HTML page and change the code so that the images are downloaded from the Sub-domain rather than the primary domain.

Once all the image codespec has been changed, and verified at least once visually, save the page and now access the page via any Browser.  Use speed test or some similar page load speed tool check the load time. I’m pretty sure that you will smile when you see the improvement.  I know I did.

Why does this work?

Serving resources ( in this specific case our page images ) from two different hostnames ( i.e. a Sub-domain or an entirely new Web server ) increases the parallelization of downloads.

What is the parallelization of downloads

The HTTP 1.1 specification (section 8.1.4) states that browsers should allow at most two concurrent connections per hostname ( although newer browsers allow more than that ).

Hence, If any HTML document contains references to more resources ( i.e. CSS files, JavaScript files, image files, and so on ) than the maximum allowed form one host, the Browser issues requests for the number permissible, and queues the rest of the requests.

As soon as some of the requests finish, the browser issues requests for the next number of resources in the queue. It repeats the process until it has downloaded all the resources.

In other words, if a page references more than X external resources from a single host, where X is the maximum connections allowed per host, the browser must download them sequentially, X at a time, making a Web server request for every X resources. The total round-trip time is N/X, where N is the number of resources to fetch from a host.

For example, if a browser allows 4 concurrent connections per hostname, and a page references 100 resources on the same domain, it will incur 1 RTT for every 4 resources, and a total download time of 25 RTTs.

You can get around this restriction by serving resources from multiple hostnames. This "tricks" the browser into parallelizing additional downloads, which leads to faster page load times.

A word of caution here, using multiple concurrent connections can cause increased CPU usage on the client. This introduces an additional round-trip time for each new TCP connection setup, as well as DNS lookup for resolving the new hostname.

Therefore, beyond a certain number of connections, this technique can actually degrade performance.

The optimal number of additional hosts is generally believed to be between 2 and 5, depending on various factors such as the size of the files, bandwidth and so on.

Hence, if your pages need a large numbers of static resources, such as images, from a single hostname, consider splitting them across multiple hostnames using DNS aliases. This technique works really well ( i.e. improves page load times ) for any web page that serves more than 10 resources from a single host.

For the best possible page load performance using this technique, make all Sub domains you created via cPanel are cookieless domains. Then be sure to evenly allocate all the image ( or other static resources ) among the different hostnames / Sub domains.

After you’ve done all of this, do use page speed ( or some similar page load speed tool ) and check the load time of the page whose download speed you are tweaking. Compare this with the Datum page load speed noted before you did this entire exercise.

I’m confident that you will be smiling like the proverbial Cheshire cat.

Ivan Bayross
Open source tutorials

working

This website uses cookies

As a user in the EEA, your approval is needed on a few things. To provide a better website experience, hubpages.com uses cookies (and other similar technologies) and may collect, process, and share personal data. Please choose which areas of our service you consent to our doing so.

For more information on managing or withdrawing consents and how we handle data, visit our Privacy Policy at: https://corp.maven.io/privacy-policy

Show Details
Necessary
HubPages Device IDThis is used to identify particular browsers or devices when the access the service, and is used for security reasons.
LoginThis is necessary to sign in to the HubPages Service.
Google RecaptchaThis is used to prevent bots and spam. (Privacy Policy)
AkismetThis is used to detect comment spam. (Privacy Policy)
HubPages Google AnalyticsThis is used to provide data on traffic to our website, all personally identifyable data is anonymized. (Privacy Policy)
HubPages Traffic PixelThis is used to collect data on traffic to articles and other pages on our site. Unless you are signed in to a HubPages account, all personally identifiable information is anonymized.
Amazon Web ServicesThis is a cloud services platform that we used to host our service. (Privacy Policy)
CloudflareThis is a cloud CDN service that we use to efficiently deliver files required for our service to operate such as javascript, cascading style sheets, images, and videos. (Privacy Policy)
Google Hosted LibrariesJavascript software libraries such as jQuery are loaded at endpoints on the googleapis.com or gstatic.com domains, for performance and efficiency reasons. (Privacy Policy)
Features
Google Custom SearchThis is feature allows you to search the site. (Privacy Policy)
Google MapsSome articles have Google Maps embedded in them. (Privacy Policy)
Google ChartsThis is used to display charts and graphs on articles and the author center. (Privacy Policy)
Google AdSense Host APIThis service allows you to sign up for or associate a Google AdSense account with HubPages, so that you can earn money from ads on your articles. No data is shared unless you engage with this feature. (Privacy Policy)
Google YouTubeSome articles have YouTube videos embedded in them. (Privacy Policy)
VimeoSome articles have Vimeo videos embedded in them. (Privacy Policy)
PaypalThis is used for a registered author who enrolls in the HubPages Earnings program and requests to be paid via PayPal. No data is shared with Paypal unless you engage with this feature. (Privacy Policy)
Facebook LoginYou can use this to streamline signing up for, or signing in to your Hubpages account. No data is shared with Facebook unless you engage with this feature. (Privacy Policy)
MavenThis supports the Maven widget and search functionality. (Privacy Policy)
Marketing
Google AdSenseThis is an ad network. (Privacy Policy)
Google DoubleClickGoogle provides ad serving technology and runs an ad network. (Privacy Policy)
Index ExchangeThis is an ad network. (Privacy Policy)
SovrnThis is an ad network. (Privacy Policy)
Facebook AdsThis is an ad network. (Privacy Policy)
Amazon Unified Ad MarketplaceThis is an ad network. (Privacy Policy)
AppNexusThis is an ad network. (Privacy Policy)
OpenxThis is an ad network. (Privacy Policy)
Rubicon ProjectThis is an ad network. (Privacy Policy)
TripleLiftThis is an ad network. (Privacy Policy)
Say MediaWe partner with Say Media to deliver ad campaigns on our sites. (Privacy Policy)
Remarketing PixelsWe may use remarketing pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to advertise the HubPages Service to people that have visited our sites.
Conversion Tracking PixelsWe may use conversion tracking pixels from advertising networks such as Google AdWords, Bing Ads, and Facebook in order to identify when an advertisement has successfully resulted in the desired action, such as signing up for the HubPages Service or publishing an article on the HubPages Service.
Statistics
Author Google AnalyticsThis is used to provide traffic data and reports to the authors of articles on the HubPages Service. (Privacy Policy)
ComscoreComScore is a media measurement and analytics company providing marketing data and analytics to enterprises, media and advertising agencies, and publishers. Non-consent will result in ComScore only processing obfuscated personal data. (Privacy Policy)
Amazon Tracking PixelSome articles display amazon products as part of the Amazon Affiliate program, this pixel provides traffic statistics for those products (Privacy Policy)
ClickscoThis is a data management platform studying reader behavior (Privacy Policy)