Link to home
Start Free TrialLog in
Avatar of glsac
glsacFlag for United States of America

asked on

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
Avatar of meverest
meverest
Flag of Australia image

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.
What version of IIS are you using?

What problem are you experiencing with the two file types?

Dave Dietz
Avatar of glsac

ASKER

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?
Avatar of glsac

ASKER

Anyone have an idea on this?
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
Avatar of glsac

ASKER

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?
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
Avatar of glsac

ASKER

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...
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
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.
Avatar of glsac

ASKER

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 :(
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
yeah!  good lateral thinking.  I'm also keen to find out if that works! :-)

Cheers.
Avatar of glsac

ASKER

Interesting...OK I am gonna give this a shot in the morning!
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
Avatar of glsac

ASKER

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?
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
Avatar of glsac

ASKER

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?
>> 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 :)
Avatar of glsac

ASKER

Any idea on how to fix that problem I had?
What is the exact command line you are using?

Dave Dietz
Avatar of glsac

ASKER

cscript.exe adsutil.vbs set w3svc/1/root/Default Web Site/vcal.aspx/DoDynamicCompression FALSE
 
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
Avatar of glsac

ASKER

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!
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
Avatar of glsac

ASKER

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!
ASKER CERTIFIED SOLUTION
Avatar of Dave_Dietz
Dave_Dietz
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of glsac

ASKER

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 :)
Avatar of glsac

ASKER

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.
Avatar of glsac

ASKER

WOW! It works...thanks so much for your time!!!!
Glad that worked for you.....  :)

Dave Dietz