Speed is one of the most important reason to make a customer visit and stay on your website. In this post, we will see how we can improve our website speed.
Following are the minimum basics that should be followed for a website:
Images are the heavy stuff on the websites. The more the images, the more slow your website will be. For our visual display using images, we can do following:
- Don’t just put images on the website. Optimize them first using Photoshop or similar tool and then upload to your website.
- Create Progressive Images so that div’s on page get their heights.
- Use tools like Font-Awesome for small icons instead of images.
- Use SVG instead of images for big icons.
- Use Sprites to combine multiple small images into one.
CSS decides how the page looks. Multiple developers create different CSS files and connect to page. Hence, there are multiple CSS files for one page which means multiple back and forth requests to server.
- Create multiple CSS but combine them into one for production.
- Remove comments from production CSS.
- Always minify your CSS.
- Put your script tags in footer instead of head section.
<script async src="somejs.js"></script>
We can also improve a website’s performance using htaccess.
- Use gzip compression to send compressed data to browser. Add following to your htaccess file: