阅读:4897回复: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 23:30
|
|
|
2楼#
发布于:2016-03-17 23:33
|
|
|
3楼#
发布于:2016-03-18 15:55
http://caniuse.com/brotli
目前就 firefox 主动开启 blink 及壳需要手动开启一个 flag 的 google 的模块已经处理了对 Accept-Encoding 头的检测 当且仅当包含 br 时才做压缩 总之 坐等 |
|
|
4楼#
发布于: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 页面测试下就知道了…… |
|
|
5楼#
发布于: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 的锅了 |
|
|
6楼#
发布于: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 字节 效果很明显 |
|
|