eZ Community » Blogs » Thiago Campos Viana » Tip: Increase your Google Page Speed...

By

Thiago Campos Viana

Tip: Increase your Google Page Speed score easily

Friday 17 February 2012 3:38:59 pm

  • Currently 3 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Here are two simple Apache/.htaccess rules that will increase your Google Page Speed score.

<IfModule mod_deflate.c>
  AddOutputFilterByType DEFLATE text/css application/x-javascript application/javascript text/plain text/html text/xml application/xml
</IfModule>
 
<filesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)$">
Header set Cache-Control "max-age=1004800, public"
</filesMatch>

The first one enables compression, the second one leverage browser caching.

Note: If you check your site score before doing these changes, it will take some time to your score be updated, but you can try with and without www in the url, maybe Google will display the score updated for one of them.

Note 2: You need to know how to force a js/css expiration... Generally just append ?vXXX to the ezdesign parameter, where XXX is the js/css version... You don't need to care about css/js that are loaded by ezjscore.

Note 3: This tip may apply to http://ez.no ;)