Categories
Linux

PageSpeed – Make your site load faster

I know this is nothing new, but I never was tuning it or checking the internals of this mod provided by Google.

With this technique you will install Mod PageSpeed in your Apache for all your sites hosted there. So the improvement would be global

1 – Test speed of your site
I normally use GTMetrix and save the results.

2 – Install
Get latest stable .deb here.

sudo wget https://dl-ssl.google.com/dl/linux/direct/mod-pagespeed-stable_current_amd64.deb
sudo dpkg -i mod-pagespeed-stable_current_amd64.deb
sudo apt-get -f install

3 – Tuning
You can check which filters are not activated by default here.
Edit file /etc/apache2/mods-available/pagespeed.conf
I added this ones, please review before.

 ModPagespeedEnableFilters insert_image_dimensions,inline_preview_images,resize_mobile_images,remove_comments,collapse_whitespace,lazyload_images,insert_dns_prefetch

I have activated few, specially to improve image, load. So I resize them, put correct size, load them only when they need to be visible etc.. just as said before review the default ones that come in the core, they are adding pretty nice stuff there 😉

4 – Restart apache

service apache2 restart

5 – Re test!
Now just compare, we got from 85% to 97%!!! 😀

Hope worked well to you as did with us 😉

PS: if you do not own a dedicated/VPS server, you can use cloudflare.com as quite good solution, I actually combine both 😉