Website Speed Optimization – Need Of The Hour
- June 25, 2015
- Leave a comment
One of the most frequently discussed issue in WordPress community is website speed optimization. Nowadays, it becomes a major concern for every website owner as traffic generation is associated with it. No one is ready to take the risk of losing even a single website visitor so, the need of the hour is that you need to optimize your website from both ends – Server side as well as Assets (JS, CSS, Images) side.
Optimization – Server-Side
Compression with Gzip:
Server side compression greatly reduces the time needed to process the request from client side, and Gzip is one of the best way to compress the resources sent by the server. For this purpose, use “mod_zip” with Apache 1.3 and “mod_deflate” with Apache 2.x. To enable Gzip compress using nginx server, you can use the following in the nginx configuration:
bc. gzip on;
# make sure gzip does not lose large gzipped js or css files
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl
gzip_buffers 16 8k;
Reduce DNS Lookups:
It takes around 20-120 milliseconds to resolve any hostname to its IP address, and browser is locked down until the process is completed.
It is recommended that there should be no more than 2-4 hostnames, that would reduce the DNS lookup time. Hence, web performance could be increased.
Customize Header Expiry/Caching:
Handling Web Images:
Images are vital part of a webpage. If these images are not properly optimized in terms of filesize, it will consume a hell lot of bandwidth which will reduce results and will increase the site load time. There are certain recommendations which should be kept in mind while development and optimizing the website:
- Use the right image extension (.jpg, .png, .gif etc) for different images. For example:
If there are a lot of colors in the image; you should use JPEG format as you can adjust the compression level in your image editor. But if you require image background to be transparent and add some opacity to it, then you should use PNG images
- Always use height and width for images while adding it to a webpage
- Do not scale images