iisencodinghttp-compression

How to eliminate mime type by using appcmd.exe


I added encoding mime type of static file for IIS by the following command such as the following. but I do not know how to eliminate the mime type. Please let me know the appcmd command to eliminate mime-type that I added one.

sample : encoding static file

appcmd set config /section:httpCompression /+staticTypes.[mimeType='text/xml',enabled='true'] /commit:apphost

I tried to the following command.

appcmd delete config /section:httpCompression /+staticTypes.[mimeType='text/xml',enabled='true'] /commit:apphost

but it shows error.


Solution

  • Add mime-type is like this:

    appcmd set config /section:httpCompression /+staticTypes.[mimeType='text/xml',enabled='true'] /commit:apphost
    

    Eliminate mime-type is like this: (please note /- instead of /+)

    appcmd set config /section:httpCompression /-staticTypes.[mimeType='text/xml',enabled='true'] /commit:apphost
    

    My test result was successful: image