概述
gzip 网页压缩比
什么是gZIP压缩? (What is gZIP compression ?)
Similar to any other software that is used to compress or recompress file, gzip too does the same task, but is considered to be very effective and the results show a convincing increase in the page load time. The gZIP compression makes use of the DEFLATE algorithm alongwith the Lempel-Ziv (LZ77) and Huffman coding.
与其他用于压缩或重新压缩文件的软件类似, gzip也执行相同的任务,但被认为非常有效,结果显示页面加载时间令人信服地增加。 gZIP压缩利用DEFLATE算法以及Lempel-Ziv(LZ77)和Huffman编码。
如何为您的页面启用gZIP压缩? (How to enable gZIP compression for your pages?)
The software compresses the webpage files hence improving the overall performance of the site. There has been a remarkable decrease in the website’s load time according to the results that even Google’s webmasters have recommended it. gZIP compression is specifically recommended for heavy/large website’s.
该软件可以压缩网页文件,从而提高网站的整体性能。 根据甚至Google的网站站长推荐的结果,网站的加载时间已显着减少。 对于大型网站,特别推荐使用gZIP压缩。
Certain applications such as Joomla offer an internal support for compressing the webpages. If you have a Joomla based website then you can simply enable it by following the below steps
某些应用程序(例如Joomla)提供了压缩网页的内部支持。 如果您有一个基于Joomla的网站,则可以按照以下步骤简单地启用它
Step 1 : Go to Global Configuration
第1步:转到全局配置
Step 2 : Then go to Server
第2步:然后转到服务器
Step 3 : There you will find an option of gZIP Page Compression, select it as ON
步骤3:您会在其中找到gZIP页面压缩的选项,将其选择为ON
Step 4 : Using http://www.whatsmyip.org/http_compression/ , you can test if the compression has been applied correctly to your website.
第4步:使用http://www.whatsmyip.org/http_compression/ ,您可以测试压缩是否已正确应用于您的网站。
Incase, you do not use web application which has any internal methods to enable the compression, you must add the below code to your existing PHP files :
如果您不使用具有任何内部方法来启用压缩的Web应用程序,则必须将以下代码添加到现有PHP文件中:
<?php if (substr_count($_SERVER[‘HTTP_ACCEPT_ENCODING’], ‘gzip’)) ob_start(“ob_gzhandler”); else ob_start(); ?>
<?php if(substr_count($ _ SERVER ['HTTP_ACCEPT_ENCODING'],'gzip'))ob_start(“ ob_gzhandler”); 否则ob_start(); ?>
gZIP如何工作? (How does gZIP Work ?)
When a user sends a request to your webpage, the webserver on which it is hosted would compress it (hence decreasing the page size) and then send it to the destination from where the request was originated. At the requester’s end, the page is decompressed and can be viewed as normal. The total time required for all this process is very negligible and much lesser than the time taken for transferring a large file over the world wide web under normal circumstances (ie. without gZIP).
当用户将请求发送到您的网页时,承载该请求的Web服务器将对其进行压缩(从而减小页面大小),然后将其发送到发出请求的目标位置。 在请求者的末端,页面已解压缩,可以正常查看。 在正常情况下(即没有gZIP),所有这些过程所需的总时间可以忽略不计,比在万维网上传输大文件所需的时间要少得多。
gZIP压缩有什么好处? (What are the benefits of gZIP Compression?)
- A significant increase in the Page Views 页面浏览量大幅增加
- Bandwidth consumption can be reduced by almost half the volume as compared to the site that does not use gZIP. 与不使用gZIP的站点相比,带宽消耗几乎可以减少一半。
- Since your webpages are kept in a compressed form over the server, Google Bots and many other search engine bots are able to crawl and index more number of pages 由于您的网页以压缩形式保存在服务器上,因此Google Bots和许多其他搜索引擎机器人可以抓取更多页面并将其编入索引
- gZIP offers you to control and compress CSS and JS gZIP为您提供控制和压缩CSS和JS的功能
Do you allow gZIP on the servers ?
您是否在服务器上允许使用gZIP?
Yes, gZIP is enabled on all our servers.
是的,我们所有的服务器都启用了gZIP。
External References :
外部参考:
http://www.gzip.org/
http://www.gzip.org/
http://www.gzip.org/algorithm.txt
http://www.gzip.org/algorithm.txt
翻译自: https://www.eukhost.com/blog/webhosting/gzip-compression-for-web-pages/
gzip 网页压缩比
最后
以上就是哭泣饼干为你收集整理的gzip 网页压缩比_网页的gZIP压缩的全部内容,希望文章能够帮你解决gzip 网页压缩比_网页的gZIP压缩所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复