Asked by:
caching of .zip files ? / zip files download as corrupted on IIS 7

Question
-
User-1249022508 posted
Hi,
I've just migrated a web site from Small Business Server 2003 to Small Business Server 2008 (running IIS7).
The web site has zip files available for download that are updated quite often.
The problem is that people trying to download these zip files are now getting corrupted zips - often with the wrong file sizes.
I suspect this may be some sort of caching issue.
I've had the users clear their browser caches. In IIS I've added an entry to the Output Caching so that zips are not cached. No luck.
Any ideas ?
Regards
Michael
Thursday, January 21, 2010 4:45 PM
All replies
-
User1073881637 posted
Have you tried this in Firefox, Chrome and IE with the same behavior?
Sunday, January 24, 2010 8:58 PM -
User-1249022508 posted
Are you aware of something that is defective in IE compared to Firefox etc in this area ? The problem occurs in the latest Internet Explorer 8.....
Sunday, January 24, 2010 9:40 PM -
User1073881637 posted
Not that I'm aware of. I've seen IE act funny in cases like this.
Try - "Enable IE 7 compatibility mode in your browser"
Sunday, January 24, 2010 9:44 PM -
User-1249022508 posted
Unfortunately the customer who reported this is on IE7. I don't think this is 'just' a browser issue. Any other ideas ?
Sunday, January 24, 2010 10:33 PM -
User989702501 posted
Well, have you tested other browsers? same? would be good to narrow down the issue if it is IE only. if all browser same issue, then might need to do a network sniff to figure it out. status code 200 for the request?
Sunday, January 24, 2010 11:05 PM -
User1073881637 posted
I wonder if this is another victum of tcp chimney offloading. :) It would be good to test all browsers though.
Here is more info on TCP Chimney off-load
Sunday, January 24, 2010 11:13 PM -
User-1249022508 posted
The fact that the only change made was the migration from SBS 2003 to SBS 2008 would indicate the problem is server related - not a browser issue. No changes were made to the web site itself at all. And my other browser testing has shown the problem is server based.
Under the IIS settings for the site I found a 'IIS' area called 'Compression'. It has two settings :
- Enable dynamic content compression
- Enable static content compression
Both were ticked by default.
I disabled both and restarted the site.
This seems to have solved the problem i.e. the browser will now download the zip uncorrupted.Do you know:
1. Why are these settings enabled by default ?
2. Why does the use of them corrupt a .ZIP file when downloaded over http ?Monday, January 25, 2010 2:22 AM -
User1073881637 posted
i can't speak to sbs 2008 default settings. The default for dynamic compression in IIS is not enabled. I've seen posts where IE downloads are corrupt and seem to be related to compression. I'd suggest opening a case with MS if you have a contract or it's impacting your business. They'll be able to help much more in your environment.
Wednesday, January 27, 2010 5:32 AM -
User989702501 posted
Ya, by default static content compression is ON but not for dynamic content.
so either open case with microsoft or see if you can find some useful information via network trace.Wednesday, January 27, 2010 8:57 AM -
User-2064283741 posted
The IIS logs should give you more information.
Look at the http status and substatus code AND the win32 error.
If you can reproduce this behaviour in IE (or whatever) use 'fiddler' to find out what is happening.
Also is that *all* that has changed. Same IP/network configuration/routing/firewalls/etc for this new server? Just because the applciation has changed it doesn't mean nothing else has.
Wednesday, January 27, 2010 11:31 AM -
User-1249022508 posted
I did nothing other than create a new site and copy the site from the old SBS2003 server.
Therefore dynamic and static compression must have been set on by default.
Now given we are talking about a ZIP file here I assume the 'Static compression' setting is the one that is causing the troubles with the .ZIP download.
Let me turn 'Dynamic compression' back on and see if the problem returns.
Wednesday, January 27, 2010 6:28 PM -
User-1249022508 posted
Interesting test results:
'Enable Dynamic Compression' 'Enable Static Compression' Zip download corrupts (Y/N)
Y Y Y
Y N Y
N Y N
N N N
So it would appear the 'Enable Dynamic Compression' is the problem i.e. corrupting .ZIP downloads.
I would have thought a .ZIP file would have been regarded as static content.
Corruption issue aside - have I misunderstood the definitions of dynamic version static content ?
Wednesday, January 27, 2010 6:39 PM -
User989702501 posted
Mmm.. hard to tell. I think MS engineer would need to get the network packet captured and analyzed before they can tell you what's going on with dynamic content compression.
Can you open a case with Microsoft support?Monday, February 1, 2010 8:19 PM -
User2117968579 posted
Funny,
I've just experiencing similar problems when hosting a ZIP file in SBS 2008 for download purpose.
Zip file size is only 24 MB, but when user click download link, it will download new zip file with total size 36MB.
My 24MB zip file was zipped again automatically and rename without extension, so my user needs to do some extra effort for unzipping, adding zip extension, and unzipping to get the original files.
Wednesday, February 3, 2010 3:17 AM -
User-1249022508 posted
Yep - that's the problem alright.
What were your compression settings ?
Wednesday, February 3, 2010 3:57 AM -
User989702501 posted
Ok.. let me see if I can get MS folks to look into this.
Friday, February 5, 2010 10:13 AM -
User-1653247517 posted
There are two questions here.
1. Why dynamicCompression was turned on by default?
2. Why zip files got dyamically compressed even though its a static file? I understand corruption was just that zip file got compressed again.
Regarding 1, IIS7 don't have dynamic compression enabled by default. Only static compression is enabled. IIS7.5 ships with both static and dynamic compression enabled by default. I understand SBS2008 comes with Win2K8 (and not Win2K8 R2). So IIS should had dynamic compression disabled. I checked with SBS team if SBS2008 setup enable dynamic compression and they confirmed that they enable it. So this out of the way.
Regarding 2, static compression only happens if request is handled by static file handler. Dynamic compression (if enabled) happens for both static and dynamic content if response qualifies for dynamic compression. You can choose mimeTypes for which dynamic compression will be attempted by controlling httpCompression/dynamicTypes collection. Mimetype for zip files is "application/x-zip-compressed". By default IIS doesn't enable dynamic compression for this mimeType. Did you enable dynamic compression for this mimeType? If SBS2008 enabled dynamic compression for this mimeType, we need to get this fixed in SBS. I am following up with SBS folks.
Thanks,
KanwalFriday, February 5, 2010 1:42 PM -
User-1653247517 posted
SBS folks confirmed that they are not enabling compression for application/x-zip-compressed or application/* mimeType. Can you tell if you made any configuration changes after installing SBS2008 like enabling exchange cas role etc?
Thanks,
KanwalFriday, February 5, 2010 3:27 PM -
User-1249022508 posted
Hi,
As far as I'm aware I didn't make any other configuration changes that could have affected this. As mentioned previously to copy this public facing web site across from the old server I just created the same site on the new server and copied the web site files across - no special config because obviously I'm completely new to SBS2008 / IIS 7
Regards
Michael
Saturday, February 6, 2010 3:16 AM -
User-1249022508 posted
Interesting follow-up - I've just built a new SBS2008 server for a customer i.e. not a migration. Did the same thing - set up a new site in IIS 7 to host their single page public web site. Guess what ? Both dynamic and static compression were enabled by default........Tuesday, February 9, 2010 3:29 AM -
User1073881637 posted
Did you use a DVD / ISO manual install or do you guys have a scripted installation process?
Tuesday, February 9, 2010 6:47 AM -
User-1249022508 posted
New SBS2008 install was done using OEM Microsoft SBS2008 DVD. Previous igration of SBS2003 to a new SBS2008 server was done using the required XML based answer file - no way to do a migration without it.
Tuesday, February 9, 2010 6:58 AM -
User1073881637 posted
I checked with a sbs2008 MVP, (susan bradley). She mentioned WSUS was installed by default and can enable compression. Can you double check that?
Tuesday, February 9, 2010 10:29 AM -
User-1249022508 posted
What do you want me to check ? WSUS is installed by default with SBS2008.
Tuesday, February 9, 2010 3:14 PM -
User989702501 posted
I'm back! errr... why are we spending time on which app or built got dynamic compress turned on by default? rather than checking why dynamic compression mess up the zip file download?
Tuesday, February 9, 2010 7:49 PM -
User1073881637 posted
at least they know how it gets turned on our suspect how using WSUS. That is something our MS IIS person could check with the SBS 2008 folks. That is step 1, the second is 'why' as you mentioned. Turn dynamic compression off on the specific folder using a specially crafted web.config in the folder hosting zip files.
Tuesday, February 9, 2010 8:25 PM -
User989702501 posted
Errr, but why dynamic compression corrupt the zip file download?
Thursday, February 11, 2010 12:40 AM -
User-400167772 posted
It gets corrupted because it's getting compressed twice (double zipped). To avoid this, and not have to turn off dynamic compression on folders that may contain zip files, edit the dynamicTypes element in the applicationHost.config file, adding an exclusion rule for zip content, e.g. <add mimeType="application/x-zip-compressed" enabled="false" />. An IISRestart is necessary after editing the .config file for the changes to go into effect.
Wednesday, November 3, 2010 1:47 PM -
User989702501 posted
Errr. zip should be static content right? as pointed out earlier.Wednesday, November 3, 2010 11:40 PM -
User-334845455 posted
Hi,
I've just migrated a web site from Small Business Server 2003 to Small Business Server 2008 (running IIS7).
The web site has zip files available for download that are updated quite often.
The problem is that people trying to download these zip files are now getting corrupted zips - often with the wrong file sizes.
I suspect this may be some sort of caching issue.
I've had the users clear their browser caches. In IIS I've added an entry to the Output Caching so that zips are not cached. No luck.
Any ideas ?
Regards
Michael
Sunday, January 15, 2012 5:12 PM -
User521890537 posted
johndempsey, the OP identified the problem is caused by compression setting in IIS.
Sunday, January 15, 2012 9:47 PM -
User-1672167363 posted
Hi johndempsey,
"Recovery Toolbox for Zip - an efficient remedy for damaged zip files"
The op does not need the tool
Thanks for information.
Martin
Tuesday, January 17, 2012 10:09 AM -
User-1117173497 posted
You may solve problem out due to next utility [url=http://www.recoverytoolbox.com/repair_zip.html]zip file recovery[/url] it provides you restoring .zip file with saving its original structure before corruption Good Luck!Monday, June 4, 2012 2:20 PM -
User384127226 posted
Can somebody help me find these settings, I couldn't find it in my IE version 9, I am checking in advanced tab of IE.
- Enable dynamic content compression
- Enable static content compression
Thanks,
Pankaj
Wednesday, June 6, 2012 4:42 AM -
User1073881637 posted
these two settings you mentioned are in Internet Manager, not IE. Static Content is enabled by default when you install IIS. Dynamic content is a role service you install extra if you want to. I'd chk with your IIS admin to see if these are enabled.Wednesday, June 6, 2012 5:21 AM -
User1584788341 posted
Have seen this thread referred to from http://forums.silverlight.net/t/185747.aspx/1
Is there any chance IIS is playing it clever and unpacks the .zip to repack it with higher compression or something, thus probably firing Silverlight security checks for man-in-the-middle attacks against XAP packages? (ClickOnce has such, so maybe Silverlight has such too)
Sunday, June 17, 2012 7:44 PM -
User989702501 posted
Doubt so, though would be pretty nice to have.
What kind of compress ratio we talking here?
Thursday, June 21, 2012 8:33 PM