Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

IIS enable GZIP compression js, css invalid how to solve

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces IIS enable GZIP compression js, css invalid how to solve the relevant knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that after reading this IIS enable GZIP compression js, css invalid how to solve the article will have a harvest, let's take a look at it.

Test results in the website speed diagnosis of Kaka Network:

Gzip compression has been successfully enabled for html web pages

Gzip compression was not successfully enabled for css files

Later research found that when iis enables gzip, only html web pages are compressed by default, and if you need to compress css, js and other files, you also need to simply configure a file.

Open the file c:\ windows\ system32\ inetsrv\ metabase.xml, and then look for "iiscompressionscheme". You will find that there are three paragraphs, and don't worry about the latter one, just set the first two. Where "/ lm/w3svc/filters/compression/gzip" is used to set gzip compression and "/ lm/w3svc/filters/compression/deflate" is used to set deflate compression.

If you want to compress static files, set hcdostaticcompression and hcdoondemandcompression to "true", and add static files to be compressed in the properties of hcfileextensions: css, js, etc.

To compress dynamic files, set hcdodynamiccompression to "true" and add dynamic files that need to be compressed: aspx, php, and so on, in the hcscriptfileextensions property.

In addition, the hcdynamiccompressionlevel property and hcondemandcomplevel property are generally recommended to be set to 9, which has the best price / performance ratio.

Refer to the following parameter settings:

After setting up, restart iis, and then find that css, js and other files have successfully enabled gzip.

This is the end of the article on "how to solve the problem of IIS enabling GZIP compression js and invalid css". Thank you for reading! I believe that everyone has a certain understanding of "IIS enables GZIP compression js, css invalid how to solve" knowledge, if you want to learn more knowledge, welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report