how to enable web service data compression on IIS6 ?
am 02.08.2007 11:07:13 von razor
Hi,
I'm trying to enable HTTP compression of my Web Service data, but i
can't manage it.
I've configured my IIS6:
1. I've added in 'web service extensions' a extension with gzip.dll -
status: allowed
2. in 'web sites' properties in IIS's management console in Service
tab, I've enabled 'compress application files', 'compress static
files', temporary dir size is unlimited, temporary directory exists
and everybody had access.
3. I've added file extensions to be compressed:
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/
HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"
cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/
HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
IISreset.exe /restart
4. in my client app I'm creating web service (i'm using .net framework
2.0)
protected WSMy wsMy;
wsMy = new WSMy();
wsMy.EnableDecompression = true;
// here i'm retrieving data asynchronious
but data that's downloaded is still not compressed (i'm checking data
size with firewall)
data length is still the same (it's an XML data with size over 10MB,
so it should compress very good)
directory: C:\WINDOWS\IIS Temporary Compressed Files is empty all the
time.
What should I do to enable compression ?
--
pozdrawiam,
razor
Re: how to enable web service data compression on IIS6 ?
am 02.08.2007 17:43:06 von David Wang
1. Unnecessary. I keep seeing this claim, so I'm sure there's some web
page out there telling people to do it, but the reality is that the
web page is not totally correct. Web Service Extension configuration
has no relation to compression, and gzip.dll is never executed like an
ISAPI Extension, so the configuration claim simply does not make sense
2. Necessary. You need to enable dynamic compression for the .asmx
extension (or whatever your Web Service has for an extension)
3. Prove that the setting causes an HTTP request to be sent with an
"Accept-Encoding" header. If it doesn't have it, IIS will not do
compression.
4. "C:\WINDOWS\IIS Temporary Compressed Files" is only used for static
compression, to store pre-compressed versions of static files. If you
think about it a little, you will realize that dynamic compression,
what you are trying to do, cannot have such a disk-based cache because
the data being caches is by definition "dynamic" and uncacheable.
I think the most important thing you need to verify is that the .Net
Framework code is making an HTTP request with Accept-Encoding request
header (i.e. client says compression is allowed) and dynamic
compression is enabled for the resource extension being request by
the .Net Framework code (i.e. IIS agrees to dynamically compress that
resource). If you prove those two things and the data is still not
compresed, then there is a bug somewhere. Otherwise, you are simply
looking at a misconfiguration/misperception.
//David
http://w3-4u.blogspot.com
http://blogs.msdn.com/David.Wang
//
On Aug 2, 2:07 am, razor wrote:
> Hi,
>
> I'm trying to enable HTTP compression of my Web Service data, but i
> can't manage it.
>
> I've configured my IIS6:
> 1. I've added in 'web service extensions' a extension with gzip.dll -
> status: allowed
> 2. in 'web sites' properties in IIS's management console in Service
> tab, I've enabled 'compress application files', 'compress static
> files', temporary dir size is unlimited, temporary directory exists
> and everybody had access.
> 3. I've added file extensions to be compressed:
>
> cscript.exe adsutil.vbs set W3Svc/Filters/Compression/GZIP/
> HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx" "ashx"
>
> cscript.exe adsutil.vbs set W3Svc/Filters/Compression/DEFLATE/
> HcScriptFileExtensions "asp" "dll" "exe" "aspx" "asmx"
>
> IISreset.exe /restart
>
> 4. in my client app I'm creating web service (i'm using .net framework
> 2.0)
> protected WSMy wsMy;
> wsMy = new WSMy();
> wsMy.EnableDecompression = true;
> // here i'm retrieving data asynchronious
>
> but data that's downloaded is still not compressed (i'm checking data
> size with firewall)
> data length is still the same (it's an XML data with size over 10MB,
> so it should compress very good)
> directory: C:\WINDOWS\IIS Temporary Compressed Files is empty all the
> time.
>
> What should I do to enable compression ?
>
> --
> pozdrawiam,
> razor