zoukankan      html  css  js  c++  java
  • thinkphp框架开启页面gzip压缩

    Thinkphp下开启gzip压缩很简单,不管你是哪个版本,只要在你的入口文件index.PHP中加入以下两行,如果你的服务器支持,那么就OK了。

    define ( "GZIP_ENABLE", function_exists ( 'ob_gzhandler' ) );
    ob_start ( GZIP_ENABLE ? 'ob_gzhandler' : null );

    例如:thinkphp3.0开启gzip压缩

    <?php
    define('APP_NAME', 'admin');
    define('APP_PATH', './admin/');
    define('APP_DEBUG',true);
    define ( "GZIP_ENABLE", function_exists ( 'ob_gzhandler' ) );
    ob_start ( GZIP_ENABLE ? 'ob_gzhandler' : null );
    require './ThinkPHP/ThinkPHP.php';
  • 相关阅读:
    作业3.14下
    作业3.14上
    作业3.13 下
    作业 3.13上
    2017.3.10上午
    2017.3.9上午
    2017.3.23-morning
    2017.3.22-morning
    2017.3.21-afternoon
    2017.3.21-morning
  • 原文地址:https://www.cnblogs.com/fxrocky/p/4239000.html
Copyright © 2011-2022 走看看