benlowery

HttpCompress

Jul 7 2008.

The open compression engine for ASP.NET

News

Oct 27, 2007 - Project Hosting now at Google Code

In an effort to allow others to easily contribute to this project, I’m not hosting it at http://code.google.com/p/httpcompress/. Head over there to track issues, contribute patches and keep up to date on what’s going on. I’ll still keep current downloads available here, but the build of the project will be taking place over on the new site.

Nov 15, 2005 - Version 6 for .NET 2.0 released!

This is a pretty simple recompile of the version 6 source, targetting the 2.0 version of
the .NET Framework. It now uses the built-in deflate and gzip streams found in
System.IO.Compression instead of #ziplib. I consider this a beta release; please test it
thoroughly before releasing it onto any production systems. [Binary Only,
Source Only]

Apr 21, 2004 - Version 6 released!

Another bugfix release:

  • Changed how the Content-Encoding header is written. It is now written on the
    first call to the compressing stream’s Write method. This fixes the issue where the
    response would come back with a header indicating it was compressed when the filter
    was really skipped. This allows Server.Transfer and the default exception reporting
    mechanism in ASP.NET to work without modification, though their output will not
    be compressed.

Mar 19, 2004 - Version 5 released!

This is mainly a bugfix release over
version 4. New Features:

  • (v5) Plays nice with the OutputCache using the VaryByHeader property.
  • (v5) No longer installs the filter if the CompressionLevel is set to “None”.
  • (v5) No longer throws an exception if a q-value cannot be parsed.
  • (v5) Properly install the INSTALLED_TAG, preventing double processing when
    a filter is not installed
  • Path-based exclusions
  • ContentType / MimeType based exclusions
  • A newer SharpZipLib

Download

Current Version
Older Versions

Known Bugs

Compression breaks when Server.Transfer is used
In ASP.NET 1.0 and 1.1, Server.Transfer and response filters do
not play well together
. Thankfully, a fix
is available
.
Images compressed with the filter are broken
This usually occurs with Internet Explorer 5.5 or 6.0. Both of these browsers cand
drop the first 2048 bytes of the response, breaking images that are compressed. The
situation is documented by KnowledgeBase articles Q312496 for
IE 6 and Q313712 for
IE 5.5. The latest service pack fixes the issue for IE6, while you have to get a hotfix
for IE 5.5.

Articles

OnDotNet -Filtering HTTP Requests with .NET
An article about filtering HTTP requests using ASP.NET. The article was based upon
my experiences building the HttpCompressionModule.

4 Responses to “HttpCompress”

  1. Avatar chiefconcern

    I have a bug I found with this compression module. I have tried to debug but have not found a way. When you use the asp substitution control with this module it causes the substition to not occur.

    Thought?

  2. Please file a bug over on the code.google.com site.

  3. I just want to inquire if this module is supported in ASP.NET Development Server environment. Thanks!

  4. If that environment supports HttpModules and Response.Filter, it should work. Are you talking about the super-Cassini that ships with the more recent ASP.NET environments?

    That said, you probably want the svn version right now. It fixes a bug with paths to apps that live off the root of the application instead of in a virtual directory.

Leave a Reply