Force https and activate mod_deflate

This is my .htaccess file that manages the https and gzip compression(server side).

The simplest way for gzip compression (PHP)

ob_start("ob_gzhandler") returns FALSE if browser doesn’t support gzip, so then is called normal ob_start();

You can use the browser header information to see if the page is compressed or a tool that checks this for you.