阅读:5750回复:24
本坛的 brotli 支持?
友坛增加了 brotli 支持
https://vivaldi.club/d/489 firefox 从 44 开启 brotli 支持 bug 366559 nginx https://trac.nginx.org/nginx/ticket/798 参考阅读 https://hacks.mozilla.org/2015/11/better-than-gzip-compression-with-brotli/ https://textplain.wordpress.com/2015/09/10/brotli/ |
|
|
1楼#
发布于:2016-03-17 22:46
论坛程序不一样吧,老实说phpwind基本半死,估计是没法支持brotli。@fiag
|
|
|
2楼#
发布于:2016-03-17 23:30
|
|
|
3楼#
发布于:2016-03-17 23:33
|
|
|
4楼#
发布于:2016-03-18 10:12
|
|
5楼#
发布于:2016-03-18 15:55
http://caniuse.com/brotli
目前就 firefox 主动开启 blink 及壳需要手动开启一个 flag 的 google 的模块已经处理了对 Accept-Encoding 头的检测 当且仅当包含 br 时才做压缩 总之 坐等 |
|
|
6楼#
发布于:2016-03-27 17:20
搞定了 ebuild
https://github.com/fiag/nginx-overlay 试试看开启了会怎么样 css, js 已经 br 了。但 html 还是 gzip, 这个怎么解? brotli on; brotli_static on; brotli_types application/xml text/css text/x-component application/x-javascript application/javascript text/javascript text/x-js text/richtext image/svg+xml text/plain text/xsd text/xsl text/xml image/x-icon; |
|
7楼#
发布于:2016-03-27 22:14
> curl https://www.firefox.net.cn/ -H "Accept-Encoding: br" -D - -s -o /dev/null HTTP/1.1 200 OK Server: nginx Date: Sun, 27 Mar 2016 14:11:48 GMT Content-Type: text/html;charset=utf-8 略 Content-Encoding: br https://github.com/google/ngx_brotli/ Enables on-the-fly compression of responses for the specified MIME types in addition to text/html. The special value * matches any MIME type. Responses with the text/html MIME type are always compressed.看来是 phpwind 主动编码的? 服务器上放个静态的 html 页面测试下就知道了…… |
|
|
8楼#
发布于:2016-03-27 22:39
> curl https://www.firefox.net.cn/themes/forum/default/template/bbs/thread_run.htm -H "Accept-Encoding: gzip, deflate, br" -D - -s -o /dev/null HTTP/1.1 200 OK Server: nginx Date: Sun, 27 Mar 2016 14:33:55 GMT Content-Type: text/html 略 Content-Encoding: br看来还真是 phpwind 主动做了编码 后台有设置可以取消么? https://www.google.com/search?q=gzip+site%3Aphpwind.net 可以确定是 phpwind 的锅了 |
|
|
9楼#
发布于:2016-03-28 14:15
aaaa007cn:> curl https://www.firefox.net.cn/themes/forum/default/template/bbs/thread_run.htm -H "Accept-Encoding: gzip, deflate...回到原帖 ![]() 管理后台没找到,只有修改代码了。 http://www.phpwind.net/read/2849167 conf/application/default.php 'web-apps' => array( 'default' => array( 'charset' => 'utf-8', 'error-dir' => 'TPL:common.windweb', 'compress' => false ) )这参数藏的好深。 |
|
10楼#
发布于:2016-03-29 23:54
fiag:搞定 ![]() 以论坛首页为例,包括所有 js 脚本、样式表 gzip 编码后共 79,058 字节 brotli 编码后共 74,141 字节 节省 4.8 KB 其中首页本身为 php 动态生成的 gzip 4,762 字节 vs brotli 4,203 字节 参考 Nick Desaulniers 的数据 或许只对 pre-compressed 的静态内容(不经常改动的 js 脚本、样式表)开启 brotli 比较好? 毕竟 on the fly 编码还是挺吃 cpu 的 不过对于页面比较大的 比如 https://www.firefox.net.cn/read-43130 页面本身 137,619 字节 gzip 30,238 字节 brotili 25,290 字节 效果很明显 |
|
|
11楼#
发布于:2016-03-30 14:26
|
|
12楼#
发布于:2016-04-23 15:36
|
|
13楼#
发布于:2016-04-25 13:20
|
|
14楼#
发布于:2016-04-30 21:04
|
|
上一页
下一页