[Windows Server 2012] Web page gzip compression

Source: Internet
Author: User

★ Welcome to The Guardian God · V Classroom, website address: http://v.huweishen.com
★ Guardian God · V Classroom is a Web site dedicated to providing server instructional video for the Guardian God, updated weekly video.
★ This section we will lead everyone: Enable site gzip compression
· Gzip high-efficiency compression of web pages, the general compression ratio of more than 50%, both to reduce the transmission of traffic, but also to improve access speed.
• No effect on image files (gif/jpg) because the files themselves are compressed.

1. Installing gzip compression
In Windows Server 2012,gzip, which is a functional module of IIS, first check whether Gzip is installed.
Not installed, we are now going to install.
The gzip is ready to install.

• Static content compression: A cache file is generated after each compression, and each access is read directly to the cache and is no longer new, and is suitable for infrequently updated content.
• Dynamic Content Compression: The cache file is not generated after each compression, and is immediately compressed every time it is accessed, with the disadvantage of consuming the CPU.
• If you change the location of the temp directory, be aware that the new directory is added with the Everyone read and write delete permission.

2, adjust JS for static compression
· After Gzip is installed, the default is almost no change, but the JS file as the dynamic compression processing, it is recommended to adjust to static compression.
Open C:\Windows\System32\inetsrv\config\applicationhost.config and find the following:
Will <dynamicTypes></dynamicTypes> "<add mimetype=" Application/x-javascript "enabled=" true "/>" and " <add mimetype= "Application/javascript" enabled= "true"/> "moves to the <staticTypes></staticTypes> zone.

3. Test compression
In the http://tool.chinaz.com/Gzips/test; To improve speed, I disabled the display of pictures.
For any reason, it takes more than two times to compress each time, and you must be careful when testing.
The htm/css/js file can be compressed, and a cache file is generated, which is static compression.
• Graphics files are not compressed.

4. Other instructions
· Gzip compression is judged by the MIME type, so you can add the file types you want to compress yourself, and I'll show you the compression of adding a. ms suffix.
• Default is not compressed.
The. Ms suffix can be compressed.

Now that this section is over, please visit the Guardian God website (www.huweishen.com) for more instructional videos.

Reprint please specify the source (http://v.huweishen.com/video/28.html), thank you!

[Windows Server 2012] Web page gzip compression

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.