SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: GZip output

  1. #1
    What a twist! Kings's Avatar
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    954
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    GZip output

    How can I send gzipped (compressed) output back to the browser, using ASP (and IIS)?

    I'm looking for a function similiar to PHP's ob_start("ob_gzhandler"); function.
    Dennis Pallett - NoCertainty - My Personal Weblog
    The Web Network: ASPit | PHPit | WebDev-Articles
    Blogs: TalkFones | Holidayzer | PHPit Blog

  2. #2
    Bangarang! Karloff's Avatar
    Join Date
    Mar 2003
    Location
    Manchester, United Kingdom
    Posts
    236
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IIS has built in compression for static pages such as htm, html, txt which you can turn on/off. You can read more about setting it up for your needs at this MS TechNet article and here.

    To compress the ASP response stream, thus your dynamic pages, you will need a component or something expensive such as XCache. While compression is sound to use on large pages it is rather pointless to incur the extra overhead on the client of decompressing small pages and often leads to longer perceived loading times. There is several other methods available to minimize the size of your dynamic pages without using compression while increasing perceived loading time on the client as demonstrated here. Yet those approaches won't save you as much bandwidth as XCache sort of compression does.
    Karl


    I'm desperately trying to figure out why Kamikaze pilots wore helmets. - George Carlin

  3. #3
    What a twist! Kings's Avatar
    Join Date
    Jul 2002
    Location
    The Netherlands
    Posts
    954
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Karloff
    To compress the ASP response stream, thus your dynamic pages, you will need a component or something expensive such as XCache. While compression is sound to use on large pages it is rather pointless to incur the extra overhead on the client of decompressing small pages and often leads to longer perceived loading times. There is several other methods available to minimize the size of your dynamic pages without using compression while increasing perceived loading time on the client as demonstrated here. Yet those approaches won't save you as much bandwidth as XCache sort of compression does.
    Hmm, that last link is quite handy to save some bytes, but it's not as good as gzipping. I can't use that component either because, a) my host won't install it and b) it's too bloody expensive.

    But I was wondering though, couldn't I make my own component that compresses the response stream? Although this would be very hard...

    Anyway, thanks for your reply, I'll see what I'll do
    Dennis Pallett - NoCertainty - My Personal Weblog
    The Web Network: ASPit | PHPit | WebDev-Articles
    Blogs: TalkFones | Holidayzer | PHPit Blog

  4. #4
    Bangarang! Karloff's Avatar
    Join Date
    Mar 2003
    Location
    Manchester, United Kingdom
    Posts
    236
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Kings
    But I was wondering though, couldn't I make my own component that compresses the response stream? Although this would be very hard...
    Depends, if you are going to write all from scratch, it could be hard in deed. Question is, why reinvent common libraries such as those for compression? Simply use an open source one such as GZIP and write a COM wrapper for it. Maybe there even is one already - not sure. However, writing your own component wouldn't solve your problem that your host wont register it on the server - chances are, your host will more likely install a well known (commercial) component that has been or is being used by many other similar hosts. There certainly are cheaper compression components than the complete caching/compression unit offered by XCache which is sort of top-of-the-range.
    Karl


    I'm desperately trying to figure out why Kamikaze pilots wore helmets. - George Carlin

  5. #5
    SitePoint Wizard wdmny's Avatar
    Join Date
    Jul 2000
    Location
    Here
    Posts
    1,010
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    XCache's component does use GZip. Anyways, as was mentioned above, you could write a GZip wrapper using the C based ZLib library, a public domain bit of code. I tried to do this myself using VC++ 6 and never did get even basic compression to work, let alone as an IIS component.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •