473,326 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Forcing Compression

Hi,

If I add the following line to Application_BeginRequest

Request.Headers.Add("Accept-Encoding", "gzip");

Will this cause the server to utilise IIS6.0 Compression even if the client
is not set to use HTTP 1.1. Does the browser need to know that it sent the
request in HTTP 1.1 in order to decompress or can it determine from the
Response header that it needs to enflate/unzip.

TIA

MattC
Nov 19 '05 #1
6 1877
check this link out for HTTP compression of IIS 6.0

http://www.dotnetdevs.com/articles/IIS6Compression.aspx

and then use the online test facility to check whether it is working
http://www.pipeboost.com/report.asp

or if you are not online you can use tools like Fiddler and WFetch (in IIs
6.0 resource kit)

HTH

Ollie Riches

"MattC" <m@m.com> wrote in message
news:en**************@TK2MSFTNGP14.phx.gbl...
Hi,

If I add the following line to Application_BeginRequest

Request.Headers.Add("Accept-Encoding", "gzip");

Will this cause the server to utilise IIS6.0 Compression even if the client is not set to use HTTP 1.1. Does the browser need to know that it sent the request in HTTP 1.1 in order to decompress or can it determine from the
Response header that it needs to enflate/unzip.

TIA

MattC

Nov 19 '05 #2
MattC wrote:
Hi,

If I add the following line to Application_BeginRequest

Request.Headers.Add("Accept-Encoding", "gzip");

Will this cause the server to utilise IIS6.0 Compression even if the client
is not set to use HTTP 1.1.

No. The code will only add the header. To enable compression for ASP.NET
with IIS6.0 do the following:
1) Follow the steps described here:
http://www.microsoft.com/technet/pro...ilbandwdth.asp
2) To set ASPX as a compressible extension, you'll have to edit the
metabase. Open "%windir%\System32\inetsrv\MetaBase.xml". Search for
"IIsCompressionScheme". There will be two XML elements, one for deflate
and one for gzip. Both elements have properties called HcFileExtensions
and HcScriptFileExtensions. These contain a space-delimited list of file
extension for compressible content. You'll need to add ASPX to the
HcScriptFileExtensions list. If the properties are left blank, then all
content, regardless of file extension, will be compressed.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/
Nov 19 '05 #3
Ah, sorry guys, need to remember to be more precise.

Ok, HTTP compression is enabled/setup on IIS6.0 and working on all machine
with IE6 using HTTP 1.1.

However, I have about 50-60 laptop users on Win98 with IE5.5 using HTTP1.0.

So, my question was asked in the context of whether me adding the code will
force this setting onto the request regardless or whether the browser has to
have it set.

Thanks
MattC

"Anders Norås" <an**********@objectware.no> wrote in message
news:uC**************@TK2MSFTNGP14.phx.gbl...
MattC wrote:
Hi,

If I add the following line to Application_BeginRequest

Request.Headers.Add("Accept-Encoding", "gzip");

Will this cause the server to utilise IIS6.0 Compression even if the
client is not set to use HTTP 1.1.

No. The code will only add the header. To enable compression for ASP.NET
with IIS6.0 do the following:
1) Follow the steps described here:
http://www.microsoft.com/technet/pro...ilbandwdth.asp
2) To set ASPX as a compressible extension, you'll have to edit the
metabase. Open "%windir%\System32\inetsrv\MetaBase.xml". Search for
"IIsCompressionScheme". There will be two XML elements, one for deflate
and one for gzip. Both elements have properties called HcFileExtensions
and HcScriptFileExtensions. These contain a space-delimited list of file
extension for compressible content. You'll need to add ASPX to the
HcScriptFileExtensions list. If the properties are left blank, then all
content, regardless of file extension, will be compressed.

Anders Norås
http://dotnetjunkies.com/weblog/anoras/

Nov 19 '05 #4
its a two way street. adding the request header at the server, tell the
browser that it can post in compressed format if it wants to (not required).
in order for the server to send compressed to the browser, the browser need
to send the same request header, so the server knowns the browser can handle
it.

to use compression, the browser must use http 1.1 for the request, and send
the compression accept header.

-- bruce (sqlwork.com)

"MattC" <m@m.com> wrote in message
news:en**************@TK2MSFTNGP14.phx.gbl...
| Hi,
|
| If I add the following line to Application_BeginRequest
|
| Request.Headers.Add("Accept-Encoding", "gzip");
|
| Will this cause the server to utilise IIS6.0 Compression even if the
client
| is not set to use HTTP 1.1. Does the browser need to know that it sent
the
| request in HTTP 1.1 in order to decompress or can it determine from the
| Response header that it needs to enflate/unzip.
|
| TIA
|
| MattC
|
|
Nov 19 '05 #5
Some browsers will handle compressed content even if they didn't ask for
it (eg. Opera) but some refuse to decode it even if it does contain the
correct headers.

When it's configured to use HTTP/1.0 IE does not send the
Accept-Encoding header to indicate that it will accept compressed
content and if a compressed response is returned it will *not* be
uncompressed even if it has the correct Content-Encoding header.

It's possible to have a more 'aggressive' approach and apply compression
based on the User-Agent but lots of other things have to be taken into
account as well (firewalls that strip the headers, proxies that upgrade
or downgrade the request and so on).

So, it's normally simpler and safer to just go off the Accept-Encoding
headers which is the "official" way the content negotiation works (to
the HTTP spec).

- Simon Green
InteSoft.NET
http://www.intesoft.net

ASPAccelerator.NET - speed up your website and save bandwidth.
ASPRedirector.NET - put a friendly face on your website.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 19 '05 #6
Ok thanks guys, as I only have to deal with IE I guess I will suggest that
the browsers be set to use HTTP1.1.

MattC
"MattC" <m@m.com> wrote in message
news:en**************@TK2MSFTNGP14.phx.gbl...
Hi,

If I add the following line to Application_BeginRequest

Request.Headers.Add("Accept-Encoding", "gzip");

Will this cause the server to utilise IIS6.0 Compression even if the
client is not set to use HTTP 1.1. Does the browser need to know that it
sent the request in HTTP 1.1 in order to decompress or can it determine
from the Response header that it needs to enflate/unzip.

TIA

MattC

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jim Hubbard | last post by:
I went to the compression newsgroups, but all I saw was spam. So, I thought I'd post his question here to get the best info I could from other programmers. Which compression algorithm offers...
1
by: Maurice Mertens | last post by:
Hello, I'm having troubles with saving a tiff-file with a certain compression and colordepth. This is the code I use: ----------------------------------------------------------------------...
8
by: Anurag | last post by:
Hi, I am told that Oracle has this "data compression" feature that allows you to store online data ina compressed format. This is different from archived data - you compress only that data which...
2
by: deko | last post by:
Is it best practice to set Unicode Compression to "No" for memo fields in a table? What about text fields? According to the VB help entry: "Data in a Memo field is not compressed unless it...
17
by: dunric | last post by:
After writing the computing urban legend "The Helsinki Code", I spent several nights thinking up how in the world Gustav Larsson, the Finnish PDP-8 computer programmer, could have managed to...
1
by: chris.atlee | last post by:
I'm writing a program in python that creates tar files of a certain maximum size (to fit onto CD/DVD). One of the problems I'm running into is that when using compression, it's pretty much...
20
by: chance | last post by:
Hello, I want to add compression to a memory stream and save it in an Oracle database. This is the code I have so far: //save the Word document to a binary field, MemoryStream dataStream = new...
21
by: =?Utf-8?B?VkJB?= | last post by:
I compressed a file with GZipStream class and is larger than the original file.... how can this be?, the original file is 737 KB and the "compressed" file is 1.1 MB. Did i miss something or is...
3
by: GiJeet | last post by:
Hello, we have an app that scans documents into TIFF format and we need to transfer them over the internet. If anyone knows of a SDK we can use that can compress TIFFs on the fly or even if it can...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.