Speeding up your webpages load time
Posted on Friday, November 17, 2006
- Introducing New Server Networking FeaturesTuesday, March 10, 2015
- Getting started with Docker in minutes using Docker MachineFriday, February 20, 2015
- MEAN & Socket.IO Integration TutorialThursday, September 11, 2014
- Getting Started with MEAN StackWednesday, August 6, 2014
- Small Dive Into Meteor.JSMonday, July 21, 2014
- How To Install Ruby on Rails on UbuntuSunday, December 29, 2013
- How to Add Swap on UbuntuMonday, December 30, 2013
- How To Deploy Django on Nginx, Gunicorn with PostgresTuesday, April 8, 2014
- Few CSS tricks you may not knowFriday, October 27, 2006
- CentOS 6 to CentOS 7 Upgrade ProcedureWednesday, July 16, 2014
Remove spaces, tabs, CR/LF from the HTML source code
It’s surprising how much people use tabs and spaces to make their code cleaner but what it does is add more pointless data to download which requires more data transfer which means longer download times. Try to not use a lot of HTML comments too. This alone can make your website faster from 7%-10%!
Obviously, this one has ups and downs. Compression can make huge size differences because there is a lot of repetition in the source code, however it causes your CPU to have much higher load. It’s a choice of high CPU load with small files or big files with no CPU load.
Force image size
If you add a picture to your website and the width/height are not specified, the client has to render the image a first time with no size, then once the whole page is downloaded, re-render it once again to decide the final size.
So, your page has several GIFs and/or JPG? It is very likely that those could be compressed even more without any loss! GIF/PNG mainly have a very compact data structure, but most applications like Corel Photo-Paint and Adobe PhotoShop don’t optimize it well. Go and find yourself a good set of tools to compact your image files. You will be surprised that one of your GIFs had 900 bytes and after compacting it, end up being just 80 bytes.