How to reduce Page load time ?
Motivation
Customer reported that the website page load time is more than 10s , so i dig deep and found some ways to reduce the page load time.
1. Optimize the image size and format
a. Use tools to resize the image, and set them to 72dpi.
b. Use image optimization tools to compress the image
2. Optimize Dependencies
a. Plugins : remove unncessary plugins from the website.
b. Tracking scripts : remove googly anaytics or other tracking if not required.
3. Avoid inline JS AND CSS
a. Put all the css and js in separate files so that these are separately being cached.
4. Optimize Caching
a. Optimize caching can help to reduce the number of calls made to the server
i. Expire headers for static content and cache control for dynamic content
b. In apache we can set the expires directive , ExpiresDefault this sets the expiration date to certain date or years
5. Avoid Render Blocking Scripts
a. place the javascript to the end or call them asynchrosously ,
6. Avoid Redirects
a. check for the broken links and fix them
7. Set up G-Zip Encoding
a. We can configure the server to return the zipped content.
8. Minification of javasript and CSS
a. We can use something called as uglify.js for this
9. Reduce Cookie Size
a. Cookies are being sent with each server calls over the time it can become really big reducing the cookie size can
i. Reduce the page load time.