国产+高潮+在线,国产 av 仑乱内谢,www国产亚洲精品久久,51国产偷自视频区视频,成人午夜精品网站在线观看

webman 不使用nginx如何開啟gzip壓縮

coding
3275 1 0
1個回答

walkor 打賞
  • coding 2020-11-27

    感謝 昨天還特意去github去翻了一下 沒看到麻煩了哈哈

  • fengshengchang 2022-04-20

    walkor github的方式有個bug
    1、有問題的使用方式:
    class Response extends \Webman\Http\Response
    {
    public function __construct($status = 200, array $headers = array(), $body = '')
    {
    $headers += ['Content-Encoding' => 'gzip'];
    $body = gzencode($body);
    parent::__construct($status, $headers, $body);
    }

    public function withBody($body)
    {
        $body = gzencode($body);
        return parent::withBody($body);
    }

    }

    2、具體問題點如下:
    請求/plugin/webman/push/push.js時,前端無法接收到push.js內(nèi)容
    您可以試一下,不用gzip方法是沒問題的
    另外,其他的js請求是正常的

  • fengshengchang 2022-04-20

    請求/plugin/webman/push/push.js時,執(zhí)行了gzip的構(gòu)造函數(shù),但是沒有執(zhí)行withBody函數(shù)

  • walkor 2022-04-20
    return response()->file(base_path().'/vendor/webman/push/src/push.js');

    改成

    return response()->withBody(file_get_contents(base_path().'/vendor/webman/push/src/push.js'));
  • fengshengchang 2022-04-20

    請問下其他靜態(tài)資源文件js和css怎么做壓縮?在StaticFile中間件里面改?

年代過于久遠,無法發(fā)表回答
??