Enable gzip compression

less than 1 minute read

Enable gzip compression

To enable gzip compression in PHP use this single line of code:


This will add the gzip headers and also tell the browser that the page is compressed using gzip, so that the browser can decompress it easily. I saved around 230% of data transfer per page using gzip.

Leave a comment