Home | Contact | Videos | MediaZo

How to optimize website loading time and performance

Internet users are quite restless and never wait if your website is too heavy to load in the normal internet connection. Web site optimization is an important phase that decides the productivity of the websites. So never frustrate your users  with slow loading time and complicated and confusing navigations.

Recently i optimized this blog after so many tricks and tips like logics to load the header files, javascripts compression , hacking wordpress plugins , compressing and optimizing the custom style sheets. Through this post i would like to convey all the important points that i implemented on the honeytechblog which helps in optimizing its loading times. You can use this free website performance tool for web page speed analysis and compare the loading time of your blogs with honeytechblog. optimization report How to optimize website loading time and performance

If your blog is not well optimized then the question is how to optimize the websites?

Their are many ways to enhance the performance of the website like these top 10 way to speed up your website, few of the experimented process apart from 20 easy ways for increasing website traffic are described as follows:

1.I checked for the use of heavy files on the home pages and figure out the objects that sucks the loading time. As a results i came to know that featured content gallery is taking too much time to load for the new users. (You can leave this option in case feature contents are important feature for your blog)

2.I checked for the number of HTTP requests from the home page. I have only single page without any iframe so this option looks fine on my homepage.

3.I checked for all the images and try to avoid the use of too many images on the homepage. This can be done by using following methods:

optimization sprites How to optimize website loading time and performance

  • Use of CSS sprites.
  • Using images from different hosts or sub domains. For example media.yoursite.com.
  • Initially their were so many images like logos, social icons, profile images, rss buttons and collectively they consume more than 100KB but after the implementation of CSS Sprites it optimized to only 31KB.

optimization sprites after How to optimize website loading time and performance

Note: I’ll cover up the CSS Sprites optimization in the up coming posts and you can also check few ways to improve your web performance using CSS-Sprites.

4.Try to avoid too many css calls on the homepage. For example wordpress plugins require large resources which calls useless css and javascripts files on the homepage.  Try to avoid <?php wp_head(); ?> on the home page and use alternative methods like i used on honeytechblog. The method is described as follows:

  1. Go to wordpress theme directory located at wp-content/themes/yourtheme and open index.php file
  2. Find the tag  <?php get_header(); ?> and replace it with below mention code
<?php
if ($_SERVER['REQUEST_URI'] != "/")
{
get_header();
}
else
{
include ("header-home.php");
}
?>

Now the above code require a new header file which doesn’t call the <?php wp_head(); ?> on the home page.

How the use of two header files works:

optimization thumb How to optimize website loading time and performance When users view the home page then it calls the header-home.php and on the other pages it will call the default header files together with your plugins.

Note: After the implementation of this trick my loading time decreased down to more than 300%. (As i used so many plugins and files on the home page but i cut it down to few specific only. I’ll cover up the must have wordpress plugins in the upcoming posts.)

How to create two header files and get them working with your theme

Follow the following process to create two homepage files:

  1. Go to your theme directory located at wp-contents/themes/yourtheme and file the file named header.php
  2. Copy all the contents of the header.php and paste them into a new file named as header-home.php
  3. Now fined the code name <?php wp_head(); ?> into your header-home.php and delete it.
  4. Now your alternate header file is ready to use but this header file is manual and you need to include few important things like meta tags and descriptions generated by “All in one SEO Plugin”. So in next step you need to find the dynamic meta contents.
  5. Open your blog in the browser and then view its source. Just search for codes between <!– all in one seo pack 1.5.1 –>  and <!– /all in one seo pack –>. It generally includes the meta tags like <meta name=”description” content=”" /> <meta name=”keywords” content=”" /> <link rel=”canonical” href=”yourdomainname.com” />
  6. Now your new header file is ready to test. Now you have options to include this header-home.php file into your theme directory or in root directory of the blog. I choose the option of root directory as its easy to edit it for future uses.
  7. As an backup option upload the header-home.php file into root directory i.e yourblog/header-home.php and also into the theme directory ie wp-contents/theme/header-home.php.
  8. Now you are completely ready to run the blog. Just don’t forget to change the index.php file described in the above mention process.

Note: You will realized that your loading time is enhanced as now their isn’t any useless calls of the plugins which is not required on the home page. For example script generated by cforms , sociable and other plugins. (if you used them only on single pages)  optimization report time1 How to optimize website loading time and performance

5.Try to avoid excess external scripts.

While checking the page source i found useless script like wp-includes/js/jquery/jquery.js so i removed it using above mention method of two header files.

6.Try to avoid use of multimedia files on the home page. Multimedia files like heavy flash and video require too much bandwidth and loading time. As discussed above i use to have the featured content gallery on the home page but i removed it while going through the optimization process. It requires more than 5 big image as an article image and more than 5 thumbnail images so after the removal it reduced the page from by more than150 Kb.

7.Shift all the media files, css and javascripts into another subdomain. Shifting css files is very simple piece of cake. Follow these steps:

  • Create a subdomain where you need to put these CSS files. For example i create media.honeytechblog.com
  • Search for style.css used in your wordpress themes i.e yourblog/wp-contents/themes/yourtheme/style.css
  • Search for images used in the style.css. Generally these images includes in the same theme folder i.e yourblog/wp-contents/themes/yourtheme/images
  • Copy the style.css and the images folder and shift then to desired subdomain. For example a)I shift the css files into media.honeytechblog.com/s1/style.css and images b)I shift the images into media.honeytechblog.com/s1/images folder. Note: I  shift the files into the s1 as a subfolder to differentiate the versions for future use. It is not necessary but things will be neat for future use.

Note: I try to keep this post short and simple but in case you have any issues then feel free to comments and i’ll try to resolve it. In coming days their will be more posts on the wordpress customizations and optimizations so its better if you subscribed to our official RSS.


Honey Singh is Head of Operations & Strategic Planning at MediaZo. He has an experience of 5 years in designing, ideating/operating digital/social marketing strategies for global brands. You can also catch him on Foursquare, Twitter, Facebook , Google+ & Instagram.

31 Responses to “How to optimize website loading time and performance”

  1. Report on: How to optimize website loading time and performance http://is.gd/1mXVr

  2. How to optimize website loading time and performance #technology http://bit.ly/ajA8B

  3. How to optimize website loading time and performance – http://tinyurl.com/lpk7h4

  4. RT @tweetmeme How to optimize website loading time and performance http://cli.gs/e1YVn

  5. Bookmark a guardar: “How to optimize website loading time and performance” ( http://bit.ly/eZeIy )

  6. How to optimize website loading time and performance http://ukn6r.tk

  7. Hey Honey Very helpful post and worth sharing. Though I think I need to digg more into the detail of every step you explained. Earlier I used to think that plugin is the best way to optimize the blog, but I was wrong.. I like the idea of hosting images on sub domains..

  8. RT @honeytech How to optimize website loading time and performance http://bit.ly/km0UD

  9. @Harsh
    Thanks.
    Due to page length and time scope, i escaped few things in this posts and will include in upcoming posts.

  10. How to optimize wordpress loading time and performance http://bit.ly/nOq83

  11. @Honey
    Will be waiting eagerly for your upcoming post on wordpress optimization series.

  12. Meanwhile could you please enable the subscribe to comment feature, I want to subscribe to all the comments on this post, but I can’t find it.
    Thanks ..

  13. Interesting ideas indeed! I was actually thinking about comments last night and this morning

  14. Does shifting the CSS / Image files into a subfolder then require you to hardcode all those images to that folder? How else will the browser know where to look?

    (new to this thanks)

  15. Browser will call the images and the files from the head of the webpage.
    If you don’r want to hard code them then you must put the css and images into sub-domain.
    This is enhance the page loading time of the webpage !
    If you have and confusions on this then please reply so that i can explain the things further ! :P

  16. thank you for information.

  17. Thanks very much. I have a blog and I am willing to optimize it like yours. But I don’t know how to. My blog add is http://pdf-to-wrod.blogspot.com, which is main about passwords recovery tech. I hope more and more people can read my blog.

  18. Now I know why so many people love this site, nice contribution. Thanks

  19. guys , is there any tools which is can check the browser performance? especially for IE, i had faces a lot of problem regarding performance issues on IE browser from my client which is website slow loading on IE browser. so i need a tool to check the website performance by browsing on IE. is there any recommendation from u guys?

  20. great info liked it…

  21. Great post, I bookmarked your blog post so I can visit again in the future, All the Best

  22. Thanks for the blog that you have. I found a new one the other day. They look open , but very similar to linkedin.com with more of a social business directory look and feel. Nice clean interface though. It’s at SocialTerrain.com

  23. Thanks for the tips bro, but using a cdn network speed up wordpress drastically.

  24. This is why we are on CDN.
    cdn.honeytechblog.com :)

  25. I used this site to check http://www.check-info.com , there have many tools for webmasters

  26. wow thanks buddy

  27. thanks mate that is what i am looking for

    cheers :)

  28. wild horses Says:

    Great article! You can do a lot of this stuff by just adding a bit of free packaged software to your site like this:
    http://www.codeproject.com/KB/aspnet/CombineAndMinify.aspx

  29. that rocks! I was looking for a guide like this to help me increase the speed on my wordpress blog :)

  30. Use least number of plugins is one of the key to ignoring delay time while loading..

Leave a Reply


three + two =