简体   繁体   中英

How to enable / disable web application compression via command line?

I'm running iis 10 on windows server 2016. I need to enable content compression for some web application and disable it for others. These check boxes specifically. iis内容压缩

Is there a way to do it via command line? preferably via powershell / appcmd.

You could enable and disable compression for site using below command:

appcmd set config "site1" /section:urlCompression /doDynamicCompression:True

appcmd set config "urlsample" /section:urlCompression /doStaticCompression:True

Result:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM