• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 853
  • Last Modified:

IIS Compression

I enabled IIS compression and now I am having problems with .ics and .rtf files...is there a way to exclude those MIME types?

-Joe
0
glsac
Asked:
glsac
  • 15
  • 12
  • 4
1 Solution
 
meverestCommented:
Hi,

compression only works when the browser at the other end supports it.  browser support should be provided as part of the request header and so IIS shouldn't compress files that are sent to clients that do not purport to support compression.

well at least that is my understanding of the matter :-}

so what I am trying to say is that you should not get such a problem just from enabling compression.  thus my question to you is what is the problem symptom, maybe the root cause is something else? (though related probably)

Cheers.
0
 
Dave_DietzCommented:
What version of IIS are you using?

What problem are you experiencing with the two file types?

Dave Dietz
0
 
glsacAuthor Commented:
I am using IIS with windows server 2003...I have compression setting up using GZIP (modified the xml file etc.) the problem which I had before when I use a custom http module for compression is that when I attempt to download an ics or rtf file that is created on the server it throws errors..or attempts to download an aspx page. I fixed this last time in my custom http Module by excluding file types rtf and ics from being compressed...so is there a way to do that in IIS as well?
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 
glsacAuthor Commented:
Anyone have an idea on this?
0
 
Dave_DietzCommented:
By default IIS will only compress HTM, HTML and TXT file types.

I'm not clear on the part about the custom HTTP module though....what is that and how does it fit into the picture?

Is this an ASP.Net HTTP Handler?

Dave Dietz
0
 
glsacAuthor Commented:
Well the httpmodule that I had is no longer used...I just remember that I had to exclude MIME types from being compressed...I also read something about Response.Flush() Response.End() that could mess it up?
0
 
Dave_DietzCommented:
Hmmm, guess the two aren't really related since IIS HTTP Compression doesn't use ASP or ASP.Net and doesn't look at MIME types at all.

How did you enable HTTP Compression in IIS?

Are you sure that the errors you are receiving are actually related to HTTP Compression?

What are the actual errors you are experiencing now?

Dave Dietz
0
 
glsacAuthor Commented:
I followed various blogs to get HTTP compression set up in IIS...and used fiddler to test and sure enough it is GZIP compressed.

I am not sure they are 100% related, but if I take compression off it works :) Seems to be related to compression.

Basically I dynamically create an ics (VCAL file) and on another page I dynamically create an rtf file...instead of these being created, it just opens up an aspx page now...does not create these files...
0
 
Dave_DietzCommented:
Ahhh, so the files are not physically there - they are created on the fly by an ASPX page?

Have you enabled compression for Dynamic content?

Do other ASPX pages work properly?

Is the directory where the pages are that create these files has the directory been set to allow scripts to run?

Dave Dietz
0
 
meverestCommented:
Hi,

so you have some aspx script that generates the vcal and delivers it (in stream) to the client?  If so, then that would be the problem I suspect, because IIS would have no way of knowingthe difference between a script that generates plain html or one that generates something different - you would need to disable compression on the application files then.

Regards.
0
 
glsacAuthor Commented:
To answer both of you...

I have enabled dyanmic-content...and other aspx pages work fine. If i disable dynamic content I kind of lose it for all aspx pages...I am trying to figure out how to do it for these 2 aspx pages...can I disable for a page level...or am I just out of luck :(
0
 
Dave_DietzCommented:
I can think of one tricky way around this.

Create a new script mapping at the root of the site or on the particular vdir these pages are in (if it is an application root of its own) called something like .aspxuc.
Set the mapping to point to C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\aspnet_isapi.dll
Set the Verbs to GET,HEAD,POST,DEBUG
Deselect 'Verify that file exists'

Now, rename your two pages from ASPX to ASPXUC.

They should now get processed like normal ASPX pages but won't get compressed since their file extensions won't match the Dynamic Compression parameters.

If you try this I'm very curious to know if it works.....  :)

Dave Dietz
0
 
meverestCommented:
yeah!  good lateral thinking.  I'm also keen to find out if that works! :-)

Cheers.
0
 
glsacAuthor Commented:
Interesting...OK I am gonna give this a shot in the morning!
0
 
Dave_DietzCommented:
Oops.  :-(

Went poking around in the Metabase settings and found a *much* easier way to do this......

There is a setting for compression that can be set at the directory or even the file level.

You can set this using adsutil.vbs:

cscript adsutil.vbs set w3svc/1/root/vdirname/filename.ext/DoDynamicCompression FALSE

Use this to set the two specific pages to FALSE for dynamic compression at it should do the trick.....

Dave Dietz
0
 
glsacAuthor Commented:
Dave-

I tried the first thing yoo mentioned .aspxuc...this did not work, as the page just hung.

This second thing you are saying:

cscript adsutil.vbs set w3svc/1/root/vdirname/filename.ext/DoDynamicCompression FALSE

I guess this is easier...but still is based off the aspxuc idea?
0
 
Dave_DietzCommented:
Nope, entirely different..

This metabase entry will tell IIS to not compress those files.

You can add this setting at the root, vdir or file level and will simply mark the content as non-compressible.

I would have suggested this first but I forgot there is a DoDynamicCompression entry as well as an HcDoDynamicCompression entry.

The Hc entry is for the service - to turn compression on or off globally.  The entry without the Hc is for individual entries to determine whether they are affected by the compression if it is enabled globally.

Dave Dietz
0
 
glsacAuthor Commented:
I keep getting Error Trying to GET the schema of the property IIS://Localhost/Schema/Default

I have the sites on a different drive (not c:\inetpub\wwwroot)...does this matter?
0
 
meverestCommented:
>> cscript adsutil.vbs set w3svc/1/root/vdirname/filename.ext/DoDynamicCompression FALSE

ooh, now there's a good reason to go hunting through metabase more often :)
0
 
glsacAuthor Commented:
Any idea on how to fix that problem I had?
0
 
Dave_DietzCommented:
What is the exact command line you are using?

Dave Dietz
0
 
glsacAuthor Commented:
cscript.exe adsutil.vbs set w3svc/1/root/Default Web Site/vcal.aspx/DoDynamicCompression FALSE
 
0
 
Dave_DietzCommented:
Ok, couple things I have found....

First, go into the IIS management console and make some sort of configuration change to the vcal.aspx page - can be something as simple as change the auth method and then chage it back.

This creates the initial metabase entry for the file.

Next, we need to change the command slightly since you have spaces in the name:

cscript.exe adsutil.vbs set "w3svc/1/root/Default Web Site/vcal.aspx/DoDynamicCompression" FALSE

All of this is assuming that the URL to the file is http://servername/default web site/vcal.aspx

If the URL is actually http://servername/vcal.aspx then use the following command:

cscript.exe adsutil.vbs set "w3svc/1/root/vcal.aspx/DoDynamicCompression" FALSE

If this is not the default web site (site instance 1) then you will need to change the 1 to whatever the site instance number is.

Dave Dietz
0
 
glsacAuthor Commented:
OK...two more questions then (BTW really appreciate this)

1. "If this is not the default web site (site instance 1) then you will need to change the 1 to whatever the site instance number is." How do I get that instance number?
2. cscript.exe adsutil.vbs set "w3svc/1/root/Default Web Site/vcal.aspx/DoDynamicCompression" FALSE --> vcal.aspx is in a virtual directory under Default Web Site...how can I make it see that?

THANKS so much!
0
 
Dave_DietzCommented:
1) If you right-click on the Web Sites folder in the management console you can see the site instance numbers listed in the right hand panel with each site.

2) Assume the vdir under the default web site is called mynamehere - the command line would look like this:

     cscript.exe adsutil.vbs set "w3svc/1/root/mynamehere/vcal.aspx/DoDynamicCompression" FALSE

If the path to the page was http://<whatever site has instance number 38878854>/mynamehere/yournamethere/vcal.aspx the command line would look like this:

     cscript.exe adsutil.vbs set "w3svc/38878854/root/mynamehere/yournamethere/vcal.aspx/DoDynamicCompression" FALSE

Hope that helps....  :-)

Dave Dietz
0
 
glsacAuthor Commented:
Well I am almost there...

I actually could not see the instance numbers, but I ran: findWeb.vbs "Default Web Site" and that gave me 4....so now I have:

cscript.exe adsutil.vbs set "w3svc/4/root/Default Web Site/Indigo/MSM/vcal.aspx/DoDynamicCompression" FALSE

Default Web Site is root site, Indigo is a folder under that (not a virtual directory)...then MSM is in Indigo and is a virtual directory. I got a Error trying to get the object....this is a different error than before. I also found that the MSM virtual site was 793338 (id in IIS)..so I tried that, but still I got the same object error :(

Sorry...but I think we are almost here this time. I do appreciate all the help!
0
 
Dave_DietzCommented:
Try this:

cscript.exe adsutil.vbs set "w3svc/1/root/Indigo/MSM/vcal.aspx/DoDynamicCompression" FALSE


or possibly (from the description):

cscript.exe adsutil.vbs set "w3svc/793338/root/Indigo/vcal.aspx/DoDynamicCompression" FALSE

What is the actual URL you use to reach this page?

Dave Dietz


0
 
glsacAuthor Commented:
Nope that did not work...the link (oddly enough) is:

http://MySite/Indigo/msm/msm/vcal.aspx (dev environment where I am testing this)

https://www.MySite.com/Indigo/msm/msm/vcal.aspx (live site)

Both about the same....the first msm is a virtual directory...seems its an extra layer deep...I do not know why this was done...but in any event :)
0
 
glsacAuthor Commented:
Well I finally got it to work...I lookek into the metafile and saw the vcal.aspx created and from there saw the root and was able to modify it...I actually could have just went in here and set the flag of compression to FALSE....but now that this is done I have to rebuild the project and test it...I will let ya know what happened.
0
 
glsacAuthor Commented:
WOW! It works...thanks so much for your time!!!!
0
 
Dave_DietzCommented:
Glad that worked for you.....  :)

Dave Dietz
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

  • 15
  • 12
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now