Adding a GZipStream or DeflateStream to Response.Filter?

Discussion in 'ASP.NET 2.0' started by ReTox, Dec 11, 2007.

  1. On my local ASP.NET Development Server, this code works :

     
  2. This code is working fine on DiscountASP.NET server(from glabal.asax file):
     
  3. Igor, thanks for the quick reply.

    Unfortunately, it doesn't work as expected. I've changed my code and tested it in Firefox - with Firebug extension, it is still the same - the length of the response is the same as HTML page. So, it is not compressed.

    I also did a test on your website - www.BestRussianBuy.com, and if this is hosted on DiscountASP.NET (tracert says so) , the compression doesn't work.

    Can we get some official answer about this issue?
     
  4. Bruce

    Bruce DiscountASP.NET Staff

    I think support is referring to IIS's HTTP compression rather than using ASP.NET's compression. I think the code should work but I have not tested.


    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  5. I pointed support to this thread on forum, so there is no misunderstanding - we're talking about asp.net compression

    The IIS compression has to be enabled with altering metabase, as far as I know
     
  6.  
  7. How big is your page? There is some initial size overhead for the GZip stream. So if you're just doing a "hello world", the gzip stream will be larger than uncompressed.

    Iused your code on a test page I made and here are the statistics according to Firefox:

    uncompressed size = 6.08 KB (6,228 bytes)
    compressed size = 0.28 KB (283 bytes)

    So it does work.




    Aristotle

    DiscountASP.NET
    www.DiscountASP.NET
     
  8. Could you please check with the following page:

    http://nexus-serbia.com/

    My firebug says response is 5kb and html is also 5kb - not compressed at all.

    Did you try my code on 'regular' DASP hosting server? On my local machine everything works fine.

    thanks,
    R
     
  9.  
  10. Aristotle,

    thanks for testing.

    I am sorry for all this fuss, it seems that something is wrong with my Firebug extension on home computer, have no idea how did this happen.

    I tested right now on my office PC, also with firebug and it is exactly as you've said: 1.903 bytes



    I apologize once again,
    R
     
  11. Yes, both code examples work as expected...

    I'm totally confused with Firebug extension bug. From now on I'll double check this issue. There is also this tool:

    http://leknor.com/code/gziped.php


    R
     

Share This Page