如何检查,如果我的共享主机提供商已安装mod_gzip的? [英] How to check if my shared hosting provider has mod_gzip installed?

查看:115
本文介绍了如何检查,如果我的共享主机提供商已安装mod_gzip的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来检查,如果我的托管服务提供商已启用mod_gzip的?它不是在网站上的任何信息所提到的,也有一个论坛,联系其他人的这个问题。
谢谢你。

Is there a way to check if my hosting provider has mod_gzip enabled? It's not mentioned in any info on the web site, nor there is a forum to contact other people about this problem. Thanks.

推荐答案

您可以检查与任何PHP的 apache_get_modules 的phpinfo

You can check that with either PHP’s apache_get_modules or phpinfo.

如果你想COM preSS您的输出,你可能会想尝试输出缓冲处理程序 ob_gzhandler 。它自动确定什么类型的编码器将接受(gzip的,放气或根本没有),并相应地返回它的输出内容。只要把 ob_start('ob_gzhandler')在脚本文件的开头(之前任何灭),它没有休息。

If you want to compress your output, you might want to try the output buffer handler ob_gzhandler. It automatically determines what type of content encoding the browser will accept ("gzip", "deflate" or none at all) and will return its output accordingly. Just put ob_start('ob_gzhandler') at the start of your script file (before anything is put out) and it does the rest.

或者你只是使用 Apache的mod_deflate模块甚至可以融为一体preSS静这是通过向客户端直接传递文件。

Or you simply use Apache’s mod_deflate that even can compress static files that are directly passed through to the client.

这篇关于如何检查,如果我的共享主机提供商已安装mod_gzip的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆