Testing with WWW vs non-WWW (Speed tests on site B – Part 2)

Oct 10, 2016 | Website speed | 0 comments

Because of the encouraging results seen in the previous speed comparison test between HostGator and SiteGround (in favour of SG), I wanted to carry out some more speed tests and see how this can be optimized further. So here goes. Note that all these tests are now only being performed on SG, and the following settings are active:

  1. Supercacher (all 3 levels)
  2. CloudFlare CDN (cache)

Note that I have NOT turned on any other CF settings like Auto Minify or Railgun.

WWW vs non-WWW for SG+ CF

There’s an interesting point to be kept in mind when using SiteGround with CloudFlare. Only the www version of the website is served via CloudFlare CDN. Hence the non-www version needs to be redirected to www.

Results with non-www address of the website

I’m specifically testing the non-www version since I think thats what most people will use. Given top of the mind recall, I dont think people type in “www” in front of a URL anymore. Unless of course they were wearing bell-bottoms to college.

I’ve setup a htaccess redirect from the non-www version to the www version as given in this SiteGround KB article.

Further observation

One observation was that part of the website resources were coming from the www domain and part from the non-www domain! This is important because only the www domain is served by CF CDN.

SO I went back and looked at all the links to resurces, and sure enough the images links didnt have “www” in them. After that change, no more resources were served from the non-www domain.

Next I’ve purged the SG and CF caches and remeasured loading speed after some time:

I noticed that in each of the tests, between 0.8 and 1 second is getting spent in redirection from the non-WWW website to the WWW website. I use .htaccess scripts to redirect.

Loading speed results with WWW

That obviously begs the question whether asking for the www site would be faster since the intial 1s spent on redirection would not be there.

Unfortunately, the results of this test were all over the place:

  • Pingdom San Jose: 2.51s
  • Pingdom Dallas: 5.48s
  • Pingdom Stockholm: 3.9s
  • GTMetrix Vancouver: 3.4s
  • GTMetrix Mumbai: 4.4s
  • Local setup: 3.88s

Its really vexing. Whatever time was previous being spent in the redirection, is now getting spent in the www page fetch, thus leaving the total load time still in the same ballpark.