How to speed up page rendering?

Today just a shorty: Enable gzip!

When using php set output_handler = ob_gzhandler. So every php request will be compressed.

Also you can use the defalte module of you apache2. In that case javascript, pure html and css will also be compressed.

  • activate the module a2enmod deflate
  • add some lines to you configureation (vhost or globle whatever you want) (global in this case)
    <Location />
    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/html text/plain text/xml text/php text/css text/js text/javascript text/javascript-x application/javascript application/x-javascript text/x-js
    </IfModule>
    </Location>
  • Don’t forget to restart the server! Do not just reload the configuration!

PS: To check the content-type on a linux command line of a web page try
lynx -head -dump http://www.google.com
PPS: Website to check the state of compression: http://www.gidnetwork.com/tools/gzip-test.php
PPS: Here is another website to check: https://www.websiteplanet.com/webtools/gzip-compression. (Tip by a reader of the blog)