Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. GZIP page

GZIP page

Scheduled Pinned Locked Moved ASP.NET
csharptutorialquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mikker_123
    wrote on last edited by
    #1

    Can someone give me C# code example of setting TransferEncoding of one page to GZIP. I just want to GZIP one page... and let's say I have Page_Load event of that .aspx:

    private void Page_Load(object sender, System.EventArgs e)
    {
    // what to write here? Is this below ok?

    // HttpWebRequest myHttpWebRequest=(HttpWebRequest)WebRequest.Create(Request.Url.AbsoluteUri);
    // myHttpWebRequest.SendChunked=true;
    // myHttpWebRequest.TransferEncoding="gzip";
    }

    tnx

    C 1 Reply Last reply
    0
    • M mikker_123

      Can someone give me C# code example of setting TransferEncoding of one page to GZIP. I just want to GZIP one page... and let's say I have Page_Load event of that .aspx:

      private void Page_Load(object sender, System.EventArgs e)
      {
      // what to write here? Is this below ok?

      // HttpWebRequest myHttpWebRequest=(HttpWebRequest)WebRequest.Create(Request.Url.AbsoluteUri);
      // myHttpWebRequest.SendChunked=true;
      // myHttpWebRequest.TransferEncoding="gzip";
      }

      tnx

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      .NET 2.0 has zipping built in. 1.0 and 1.1 do not. You can set the headers, but you can't actually zip the data without an external library. Christian Graus - Microsoft MVP - C++

      M 1 Reply Last reply
      0
      • C Christian Graus

        .NET 2.0 has zipping built in. 1.0 and 1.1 do not. You can set the headers, but you can't actually zip the data without an external library. Christian Graus - Microsoft MVP - C++

        M Offline
        M Offline
        mikker_123
        wrote on last edited by
        #3

        Hmph... can you give me some insights onto this subject? Any links? Supposing that I have GZIP compressor what should I do next? Compress the stream and just Response.Write it?

        C 1 Reply Last reply
        0
        • M mikker_123

          Hmph... can you give me some insights onto this subject? Any links? Supposing that I have GZIP compressor what should I do next? Compress the stream and just Response.Write it?

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          good_ol_mike wrote: can you give me some insights onto this subject? Any links? Not for GZip, sorry. good_ol_mike wrote: Compress the stream and just Response.Write it? Yeah, that's basically it. Christian Graus - Microsoft MVP - C++

          M 1 Reply Last reply
          0
          • C Christian Graus

            good_ol_mike wrote: can you give me some insights onto this subject? Any links? Not for GZip, sorry. good_ol_mike wrote: Compress the stream and just Response.Write it? Yeah, that's basically it. Christian Graus - Microsoft MVP - C++

            M Offline
            M Offline
            mikker_123
            wrote on last edited by
            #5

            Ok if anyone else finds this topic in similar search should look: -> http://www.blowery.org/code/HttpCompressionModule.html[^] (really cool thing) Best alternate idea (removing white spaces and reducing size of ur HTML that way, but results are by far worse than using HttpCompressionModule) -> http://www.ondotnet.com/pub/a/dotnet/2003/10/20/httpfilter.html[^] (author of Compression Module) -> http://www.codeproject.com/aspnet/RemovingWhiteSpacesAspNet.asp[^] -> http://www.codeproject.com/aspnet/WhitespaceFilter.asp[^] (C# version in comments) cheers

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups