Skip to content

Latest commit

 

History

History
12 lines (9 loc) · 348 Bytes

enable-gzip-compression.md

File metadata and controls

12 lines (9 loc) · 348 Bytes

Enable gzip compression

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

  <?php
    ob_start("ob_gzhandler");
  ?>

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.