最新的主机域名优惠信息

Godaddy主机如何开启Gzip压缩

 

为什么要开启Gzip压缩呢?原因很简单:使用Gzip压缩技术能让用户感受更快的速度。这一般是指WWW服务器中安装的一个功能,当有人来访问这个服务器中的网站时,服务器中的这个功能就将网页内容压缩后传输到来访的电脑浏览器中显示出来.一般对纯文本内容可压缩到原大小的40%.这样传输就快了,效果就是你点击网址后会很快的显示出来.当然这也会增加服务器的负载. 一般服务器中都安装有这个功能模块的。

那么,Godaddy主机如何开启Gzip压缩呢?

 

针对Godaddy的Linux主机,我们需要设置的是php.ini.htaccess配置文件.

首先,在网站根目录下找到php5.ini文件,添加如下代码:

output_buffering = Off
output_handler =
zlib.output_compression = On
zlib.output_compression_level = 6

 

其次是在网站根目录下的.htaccess文件里添加如下代码:

addhandler x-httpd-php5-cgi .php .html .htm .js

注意:如果网站下不存在这2个文件,需要手动创建该2个文件,如果你的主机是php5版本以上,则需要修改的是php5.ini文件,就是将php.ini重命名为php5.ini。

 

最后,可以通过http://yanghao.org/tools/gzip查询网站是否开启了GZIP。

 

针对Godaddy的Windows主机,我们需要设置的是web.config配置文件。

直接在网站的根目录下的web.config文件里添加以下代码:

<?xml version=”1.0″ encoding=”UTF-8″?>
<configuration>
<system.webServer>

<urlCompression doStaticCompression=”true” doDynamicCompression=”true” />

<rewrite>
<rules/>
</rewrite>
</system.webServer>
</configuration>

保存即可,如果网站下没有该web.config文件,可以手动创建。

 

最后,可以通过http://yanghao.org/tools/gzip查询网站是否开启了Gzip。

 

原创文章如转载请注明:美国主机资讯站

已经有4 个评论,你也说点什么吧

  1. fila 说:

    I not to mention my friends were examining the nice advice from your web blog and unexpectedly came up with an awful feeling I had not thanked the web blog owner for them. Most of the young men ended up consequently happy to read all of them and now have surely been loving these things. Thanks for getting indeed helpful and then for opting for this kind of wonderful subjects most people are really desirous to know about. My personal sincere apologies for not expressing gratitude to you sooner.

  2. kyrie 3 shoes 说:

    I needed to send you the little bit of observation so as to give thanks the moment again for those pretty ideas you’ve shared here. This has been simply tremendously generous of you to supply publicly exactly what numerous people would have made available for an ebook to generate some cash for their own end, principally considering the fact that you could have done it in case you considered necessary. These tricks also worked to become easy way to fully grasp that someone else have similar passion the same as my personal own to realize whole lot more when it comes to this matter. I’m sure there are some more pleasant sessions in the future for those who view your website.

  3. fila 说:

    Thank you a lot for providing individuals with an exceptionally spectacular possiblity to discover important secrets from this blog. It’s usually very great plus stuffed with a good time for me personally and my office co-workers to search your blog at the least thrice in 7 days to find out the latest things you have. And lastly, I’m usually motivated for the gorgeous advice you serve. Some 1 ideas on this page are undeniably the most effective I’ve ever had.

  4. polo ralph lauren 说:

    I have to show my thanks to the writer for rescuing me from this particular dilemma. Because of researching throughout the online world and meeting tricks that were not helpful, I assumed my life was gone. Living without the answers to the problems you have sorted out through your entire write-up is a crucial case, and ones that might have in a wrong way damaged my career if I had not encountered the blog. That skills and kindness in touching all things was excellent. I am not sure what I would’ve done if I hadn’t come upon such a subject like this. I am able to at this moment look forward to my future. Thanks for your time very much for this professional and results-oriented help. I won’t be reluctant to endorse your site to any person who should get guidance on this situation.

发表评论

*

* 绝不会泄露


Design By HostChoose | Power By Hostchoose