12 Ways to make your site Load Faster

I wanted to write a blog post covering list of tools and websites to measure how fast your site loads since recent Google algorithm changes do gives more value to the site loading speed but thought before writing that post, I am better off writing ways to make your site load faster and suggestions on site optimization.

So here are 12 ways to Optimize your website to make it load faster (many of these I am already using at inBoundio)

1. Use Caching – This is a must and has to be the first step to increase site loading speed. For anonymous users, ideally you don’t want to make a server request every time since the site content doesn’t change with every visit so you can use caching. Every decent framework and CMS has caching modules so you just need to configure them and you are good to go.

If you are using WordPress, you can use W3 cache plugin. Drupal already have caching by default though you do have to enable it. Codeigniter, RoR and Django web frameworks already have caching enabled by default.

2. Use CSS Compression – WordPress, CSS and web frameworks come up with CSS compression option (or have existing modules/plugins) which you should install. You can also use CSS Compressor or Minifycss to compress CSS files.

3. Use JS Compression – Just like CSS, you also want to minify JavaScript to reduce the size of the files. Again most of the CMS and framewoks come with this option, if you are using static JavaScript files, you can use YUI JS compressor to minify your js file.

4. Ese External CSS libraries – If you are using standard CSS libraries, you may want to use hosted CDN for it since they are already cached by browsers and hence make the page loading much faster. Make sure you are using the minify version of the css file though. You can search at CDNjs to find various css libraries.

5. Use External JS Libraries – Just like css, you also want to use CDN hosted JS libraries. You can use Google CDN and Microsoft CDN to find your js libraries and link to them instead of hosting them on your server.

6. Minimize the image sizes – Try to avoid larger images on your pages. If you are using width and height html tags, you are probably better of uploading that size of image anyway. I have found some really good CSS tricks on CSS Tricks blog with images so you can try them too.

7. Minimize http requests – You can use YSlow chrome/firefox plugin to see how many http requests you are making to server and what is the server response time. If you are using CSS/JS compression and bundling them (so multiple files are made into one), you should be fine.

8. Use CDN – If you are hosting your files/content on Amazon S3, you can use CDN option to chose in which continent you want to keep your content depending on your traffic.

9. Optimize your server hardware – If you are on VPS, may be you want to move to dedicate server or to AWS as VPS are often oversold. You do want to look at your hardware and look for faster hard drives (faster I/O) and high speed network I/O. If you are unsure about your needs, you should check WebHostingTalk specially their offers section where you can find really good cheap hosting deals as well as knowledgeable crowd to guide you.

10. Optimize your database – If you know what you are doing, optimizing databases can do wonders to your site performance. You should use Indexes where ever possible and try to find which queries are taking too much time and try to simplify them. If you are not able to figure out, ask to your web host as most of them already have pre written scripts for their server.

11. Load JavaScript at footer – You should always load JavaScript before /body tag, this is standard practice as it first you want the content to load and then JavaScript code.

12. Use memcache, varnish, lighttpd and nginx – Most of the sites are using php + apache on the web but you can explore better options too depending on the nature of the sites. For example, you can choose lighttpd over apache as it is lightweight with less memory print. Nginx can be used as reverse caching proxy to optimize Apache performance.

  • Alossia

    Thanks for this useful post! I’ve bookmarked for future reference. Another site that I also recommend that you haven’t included in your post is http://www.dreame.biz. I love it because it has more than 50+ Tutorial.

  • Vivek Moyal

    i have a website http://www.tellmequotes.com. I have nearly many pages and database use is too high so it took too much time to get load. So is it good to make it using some sort of Frameworks or should i use the native programming

  • lukman nakib

    great post!