How to implement GZip compression in ASP.NET?

后端 未结 9 888
后悔当初
后悔当初 2020-11-27 10:21

I am trying to implement GZip compression for my asp.net page (including my CSS and JS files). I tried the following code, but it only compresses my .aspx page (found it fro

9条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-27 10:54

    You can just add the following to your web.config file within the element:

    
    

    NOTE: If you are using an older version of IIS (less than v7.5), you may want to set doDynamicCompression to false because the process was CPU intensive. These issues were cleared up in IIS 7.5.

    Reference: https://docs.microsoft.com/en-us/iis/configuration/system.webserver/urlcompression

提交回复
热议问题