Gzip compression on IIS - Can't get it to work with or without episerver.


I have an existing IIS application, and I am trying to get GZIP server side compression to work. The application runs on EPIServer CMS (which I am not that familiar with) - Thinking this could be related to the CMS somehow, as a first step...

I decided to create a new IIS application and this time using Umbraco (another CMS that I am very familiar with) - I have created a basic page with some CSS files and images, but when I look in the response headers I can't see the:

Content-Encoding: gzip


This is what I have tried and checked.

1. Working locally, I am running windows 10. and IIS 10
2. I have enabled Dyamic Content Compression and Static Content Compression under Internet Information Services > Performance Features in Windows Features
3. For the locally set up website in IIS I have ensured that the compression section has both Enable Dynamic & Static check boxes are ticked.
4. In my web-config file I have added this single line

When the Webconfig has this line I inspect the headers in my browser


Accept: text/css,*/*;q=0.1
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9
Host: umbracotest.site
Proxy-Connection: keep-alive
Referer: http://umbracotest.site/
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.117 Safari/537.36


Accept-Ranges: bytes
Content-Type: text/css
Date: Tue, 01 May 2018 15:09:02 GMT
ETag: "03739d0e978d31:0"
Last-Modified: Tue, 19 Dec 2017 16:52:54 GMT
Transfer-Encoding: chunked
Vary: Accept-Encoding

5. If I change that webconfig line slightly - dynamicCompressionBeforeCache="false" to true - *then I just get a whole bunch of symbols in the browser - does that mean anything?*

6. If I add a few more lines in to my webconfig to look like this:



headers are still the same.

7. C:\inetpub\temp\IIS Temporary Compressed Files\MYAPPPOOL-NAME <>< this folder is created but empty.

This is a ASP.net MVC application
Any ideas?

May 01, 2018 17:39

Hi Ayo,

The first thing to check would be whether the compression features in IIS are enabled on the machine that you're testing on. If you go to "Turn windows features on or off" from the control panel then go to Internet information services > World wide web services > Performance features, you should see two boxes for static and dynamic compression which should be ticked.

I'd also recommend that you don't try to compress jpeg and png files as they are already pretty well compressed so you're just using up system resources for no benefit.

May 01, 2018 19:04

So after banging my head on the wall for about 8 hours, I finally got it to work!

After checking everything twice, reading every post I could find on the topic, I came across a comment to a similar question that suggested it could be something to do with my antivirus software. I'm working in an enterprise environment and I don't have the rights to disable it on my local machine. So I deployed the code to our staging server......... and it works.

So in case someone else has this problem, try and disable your anti-virus and see if that makes any difference, it worked for me.

May 02, 2018 12:23

Do you have a windows defender enabled? If there is or any other Antivirus installed then disable it. It might be related to your antivirus honestly. Worked for me when I disabled my K7 Total Security. Well, it is actually the firewall settings which blocks the access.

Jul 05, 2018 23:21

A bit late reply but i just found this thread while searching for something else :)

Depending on how your antivirus works it could potentially be a proxy and IIS by default doesn't compress the response if it comes through a proxy. To fix this you set noCompressionForProxies to false (true by default) in httpcompression element.


Aug 29, 2018 8:34
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.