PHP Manual GZip Encoding

前端 未结 3 1106
暖寄归人
暖寄归人 2020-12-29 08:29

I was testing my website with Page Speed and the result was around 70/100. Enable Compression was the first and most important factor in slowing it down.

I know that

3条回答
  •  生来不讨喜
    2020-12-29 08:59

    I'd suggest to use http://php.net/manual/de/function.ob-gzhandler.php, this works out of the box for me:

    In my index.php I just place this before some output:

        /**
         * Enable GZIP-Compression for Browser that support it.
         */
        ob_start("ob_gzhandler");
    

    And it encodes it!

提交回复
热议问题