IIS 7 compression not working
Asked Answered
P

3

7

I have a Windows server 2008 R2 with IIS 7.

By default when you create a site in IIS, Compression is enabled. I checked the Compression module and both Checkboxes are checked.

Now, I am using fiddler to check if pages are being compressed but it seems they are not as the No Compression is selected and the page size is over 100 KB.

Why pages are Not compressing even though Compression is enabled in IIS 7 ?

Any suggestions will be highly appreciated.

Thanks.

Prevail answered 18/9, 2010 at 5:33 Comment(0)
C
5

I've come to a solution :-) This solution ALWAYS serves a compressed version.

For me too, in IIS 7.5 Manager, I have checked Both boxes, in order to compress both :

  • Static files
  • Dynamic files

Sometimes (the first-time a webpage is served), it is UNCOMPRESSED. Then, only the second time, it is COMPRESSED.

The following solution comes from here : http://www.codeproject.com/Articles/242133/Making-the-most-out-of-IIS-compression-Part-conf

In order to get IIS to ALWAYS cache the compressed version, rather than the uncompressed version, modify the applicationHost.config file. You'll normally find this file in the folder C:\Windows\System32\inetsrv\config:

  1. Make a backup copy of applicationHost.config.
  2. Open applicationHost.config with a text editor, — or — In IIS Manager, navigate to Default Website > Configuration Editor and go to the section "system.webServer/urlCompression"
  3. Find the section.
  4. Add the dynamicCompressionBeforeCache="true" attribute to the urlCompression element,
  5. Collapse | Copy Code

  6. Save the applicationHost.config file
  7. Reset the IIS server to make the new attribute take effect
  8. Start IIS Manager, click the server at the top of the tree, and then click Restart on the right-hand side

I Hope it will save your day, as it saved mine !

Callus answered 2/8, 2014 at 12:28 Comment(0)
V
17

Are your pages' content dynamic (i.e. .aspx or .php)? If so, does your IIS have the dynamic content compression module installed? You can tell by looking at the "Enable dynamic content compression" checkbox. If it is grayed out, then it is not installed.

To install it, please refer to the following link:

Enabling Dynamic HTTP Compression in IIS7 on Windows Server 2008

Essentially, it says (with lots of pictures) that you must add the Dynamic Content Compression role service through Server Manager, and then ensure that it is enabled in IIS Manager.

Valverde answered 27/4, 2011 at 18:18 Comment(0)
C
5

I've come to a solution :-) This solution ALWAYS serves a compressed version.

For me too, in IIS 7.5 Manager, I have checked Both boxes, in order to compress both :

  • Static files
  • Dynamic files

Sometimes (the first-time a webpage is served), it is UNCOMPRESSED. Then, only the second time, it is COMPRESSED.

The following solution comes from here : http://www.codeproject.com/Articles/242133/Making-the-most-out-of-IIS-compression-Part-conf

In order to get IIS to ALWAYS cache the compressed version, rather than the uncompressed version, modify the applicationHost.config file. You'll normally find this file in the folder C:\Windows\System32\inetsrv\config:

  1. Make a backup copy of applicationHost.config.
  2. Open applicationHost.config with a text editor, — or — In IIS Manager, navigate to Default Website > Configuration Editor and go to the section "system.webServer/urlCompression"
  3. Find the section.
  4. Add the dynamicCompressionBeforeCache="true" attribute to the urlCompression element,
  5. Collapse | Copy Code

  6. Save the applicationHost.config file
  7. Reset the IIS server to make the new attribute take effect
  8. Start IIS Manager, click the server at the top of the tree, and then click Restart on the right-hand side

I Hope it will save your day, as it saved mine !

Callus answered 2/8, 2014 at 12:28 Comment(0)
S
1

We were experiencing the same issue, but with IIS8. Turning off Dynamic and Static compression did the trick, but you'll need to restart IIS after altering the setting.

Studbook answered 7/11, 2014 at 15:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.