Alibabacloud.com offers a wide variety of articles about wordpress enable gzip compression, easily find your wordpress enable gzip compression information here online.
Gzip compression actually compresses webpage content to reduce htmlCodeThe cost of network transmission to improve web performance.
The request process is explained.:
1: client request. Http_header will send the corresponding encoding rules according to the corresponding browser,
This indicates that the "I" client browser supports gzip and deflate
By default, Nginx gzip compression is off, gzip compression function is to allow you to save a lot of bandwidth, but will increase the cost of the server CPU Oh, nginx by default only text/html compression, if you want to compress the content outside the HTML, We need to adj
Document directory
Correct differentiation between mod_deflate and mod_gzip
Enable gzip of apache2
More Customization
Supplement
Enable the gzip function of apache2
Gzip greatly reduces the bandwidth (about 60%-75%) of webpages during transmission while consuming a lit
Enable HTTP compression (gzip)
Configuration of gzip compression in iis7 is much easier than IIS6, and gzip compression is enabled by default. If no, you can find the "
One page reduction 10KB for a small site, is not what, but for large sites, the cumulative is a lot of traffic ... gzip compression is an effective and feasible approach, but requires Apache support (Apache has a common port solution with IIS).
Traditional JS Compression (delete annotations, delete extra space, etc.) to provide the
, Traviata"
13 compressablemimetype = "text/html, text/XML"
14 -->
From above8th rowsYou can add the following attributes to the connector instance to use the gzip compression function.1) compression = "on" enable the compression function2) compressionminsize = "2048" enable
Gzip compression can help us save bandwidth. It can help us to compress 10 k files to 3 K. This ratio is very high. Next we can see that Nginx enables gzip compression (image, file, css) configuration. Gzip compression can help us
Metabase PropertyNote: These two attribute values are generally recommended to be set to 9, with the best cost effectiveness.
Note:
1. stop IIS before editing MetaBase. xml. You can use net stop iisadmin2. After the modification is complete, enable the iisadmin service and execute the iisreset command.
SEO Testing
Whether compression has an impact on SEO. After testing, it can still be well recorded af
dynamic files, set hcdodynamiccompression to "true ",Add the dynamic file suffix you want to compress in hcscriptfileextensions, such as aspx;To Compress static files, set hcdostaticcompression and hcdoondemandcompression to "true ",Add the extension name of the static file to be compressed in hcfileextensions, such as XML and CSS;Hcdynamiccompressionlevel and hcondemandcomplevel indicate the required compression ratio. The value ranges from 0 to 10.
Article Source
HTTP compression is a method for transmitting compressed text content between web servers and browsers. HTTP compression adopts common Compression Algorithm Such as gzip to compress HTML, JavaScript, or CSS files. The biggest advantage of compression
: S', time (). 'gmt ';Header ("Last-Modified:". $ gmt_mtime );// Enable gzip compressionOb_start ();... Your php code...... Your php code...... Your php code...Header ('content-Length: '. ob_get_length ());Ob_end_flush ();
If you have Server permissions, refer to apache to enable gzip transfer.
1. find your http
server to the compression buffer directory to check whether the requested file has the latest compressed file;If the compressed file of the requested file does not exist, the Web server returns the uncompressed request file to the browser and stores the compressed file of the requested file in the compressed buffer directory;If the most recent compressed file of the requested file already exists, the compressed file of the requested file is returned
No-cache;off– shutdown all proxy results data compressionexpired– enable compression If the header contains "Expires" header informationno-cache– enable compression If the header contains "Cache-control:no-cache" header informationno-store– enable
How to view your site has been opened gzip?
Method-:
Through the online tools such as (Webmaster's home) inquiries, such as my blog opened in the query as shown: QQ screenshot
Method Two:
Look through the browser's review element or Firebug to see if the header returned by the server contains "gzip"
As shown in figure:
How do you open it?
To enable
With the development of nginx, more and more websites are using nginx, so the optimization of nginx becomes more and more important. Today, let's take a look at how gzip compression of nginx is compressed?
Gzip (GNU-zip) is a compression technology. After gzip
PHP enables gzip page compression instance code. To implement GZIP compression pages, the browser and the server need to support them. in fact, the server is compressed. after being uploaded to the browser, the browser decompress and parse the files. We don't need to worry about the browser. to compress the
",Add the extension name of the static file to be compressed in HcFileExtensions, such as xml and css;HcDynamicCompressionLevel and HcOnDemandCompLevel indicate the required compression ratio. The value ranges from 0 to 10. The default value is 0.HcDynamicCompressionLevel attribute description: HcDynamicCompressionLevel Metabase PropertyHcOnDemandCompLevel attribute description: HcOnDemandCompLevel Metabase PropertyNote: These two attribute values ar
of the compressed biscuit, raw material ');
}
Output compression Results
Ob_end_flush ();
This is Ob_gzip compressor.
function Ob_gzip ($content)
{
if (!headers_sent ()
extension_loaded ("zlib")
Strstr ($_server["http_accept_encoding"], "gzip")
{
$content = Gzencode ($content. "\n//This page is compressed", 9);
Header ("Content-encoding:gzip");
Header ("vary:accept-encoding");
Header ("Content-length:".
attribute Description: HcDynamicCompressionLevel Metabase Property
HcOnDemandCompLevel attribute Description: HcOnDemandCompLevel Metabase Property
Note: These two property values are generally recommended to be set to 9, with the best price/performance ratio.
Attention
1. To stop IIS before editing MetaBase.xml, you can use the net stop IISAdmin
2. After the modification is complete, turn on the IISAdmin service and execute the IISRESET command
About the SEO test
Whether the
PHP Instance gzip Transfer page
The code is as follows
Copy Code
Can be used for static resources and HTML pages, which are also suitable for other languagesCache Expiration Time (Cache-control, http1.1), recommended for use$secs = 0; SecondsHeader ("Cache-control:s-maxage= $secs, max-age= $secs, Must-revalidate, proxy-revalidate");Cache expiration Time is 24 hours (Expires)$offset = 3600 * 24;$expire = "Expires:". Gmdate (
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.