- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我可以通过将 zlib.output_compression
指令设置为 on
来压缩输出,然后将 output_buffering
指令设置为 off
?
其次,我读到我可以为指定特定缓冲区大小的 zlib.output_compression
指令设置一个数值。但是,如果我也将 output_buffering
指令设置为不同的字节数怎么办?最大缓冲区大小是多少?
最佳答案
是的,您可以通过这种方式压缩 PHP 输出,但是网络服务器(nginx、Apache)可以对所有类型的内容(css Assets 等)进行更有效的压缩,而不仅仅是 PHP 输出:)
是的,您可以将 zlib.output_compression 设置为数值 http://php.net/manual/en/zlib.configuration.php#ini.zlib.output-compression
This option also accepts integer values instead of boolean "On"/"Off", using this you can set the output buffer size (default is 4KB). As for max buffer size, you cant set it more than web-server can handle. For example, nginx use 4K or 8K output buffer. http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_buffer_size
ob_gzhandler 压缩级别使用 zlib.output_compression_level,默认为 -1,级别 6(默认值 -1,让服务器决定使用哪个级别)。但! PHP手册http://php.net/manual/en/function.ob-gzhandler.php说:
You cannot use both ob_gzhandler() and zlib.output_compression. Also note that using zlib.output_compression is preferred over ob_gzhandler().
关于php - zlib.output_compression 和 output_buffering,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25363864/
首先明确一下PHP的输出顺序 1.打开了php输出缓存: echo,print -> php output_buffring -> server buffering -> brow
从 phpinfo() 输出: Loaded Configuration File => /usr/local/lib/php.ini output_buffering => 0 => 0 里面 /u
我即将启动一个网站,我正在检查我的 php.ini 以准备生产环境的所有设置。 我正在考虑是将 output_buffering 保持打开、关闭还是将其设置为缓冲区限制(如 4096)。打开或关闭 o
我正在尝试测试 rails helper 中的 html block 方法: def dashboard_widget(header, &proc) concat('') etc end 代码
我可以通过将 zlib.output_compression 指令设置为 on 来压缩输出,然后将 output_buffering 指令设置为 off? 其次,我读到我可以为指定特定缓冲区大小的 z
我一直在 php 中使用 output_buffering(由 phpinfo() 确认),我刚刚发现打开它后,我会开始随机出现 404 错误在我的页面上,但页面内容加载正常,一切看起来都正常。 这只
我正在尝试创建一个简单的 View 助手,但是一旦我尝试嵌套几个内容标签,它就会抛出 NoMethodError: undefined method `output_buffer=' for def
我正在这样尝试我的代码 if (isset($_GET['year'])) { $year=$_GET["year"]; } else { if (date("n")>=6) {
正如标题所述,我在 Azure 中有一个共享 Web 应用程序,其中包含 PHP 5.4 以及安装的站点扩展 PhpManager(通过 Kudu)。我已使用 PhpManager 将主 php.in
正如标题所述,我在 Azure 中有一个共享 Web 应用程序,其中包含 PHP 5.4 以及安装的站点扩展 PhpManager(通过 Kudu)。我已使用 PhpManager 将主 php.in
在 lib/my_lib.rb class MyLib include ActionView::Helpers::TagHelper def foo content_tag
我是一名优秀的程序员,十分优秀!