I was prototyping a new web product a few days ago and I wanted to enhace customers’ mobile experience.
The results from the Google PageSpeed test were pretty alarming: my prototype was very slow.
I was determined to improve the website speed, but I couldn’t afford to spend too much time on it since it’s in the prototyping phase.
In less than an hour I was able to take the PageSpeed score from 41 to 80 by tracking the most severe (and basic) problems.
All serious websites should have these three problems covered in a way. If you are unsure if your website has it covered, just use PageSpeed.
Lossy compression of images
We all know that one of the main reasons why many websites load slow are the images.
I’ve got very good results by just using two simple command lines tools: pngquant and jpegoptim.
Expirty date in HTTP headers
This is what Google says regarding having a expiry date in the HTTP headers:
Setting an expiry date or a maximum age in the HTTP headers for static resources instructs the browser to load previously downloaded resources from local disk rather than over the network.
Fixing this problem can take you literally seconds if you are using apache webserver. First, you have to activate mod_expires:
Second and last, add a rule to make all static files expire after one month.
In my case it was very easy since I have a different directory configured to server them: