PC Review


Reply
Thread Tools Rate Thread

Automatically Compact HTML on render

 
 
Untitled
Guest
Posts: n/a
 
      16th Aug 2005
Is there a component that i could use to automatically compact (remove
white spaces, new lines maybe, etc..) the rendered HTML pages?

When writing HTML, developers like to add spaces and newlines to make
the code more readable. When a single space is added to a datagrid
control, and this datagrid control has renders a 1000 items, this adds
1000 useless spaces to the HTML output.

Is there any way to get arround this? To have ASP .NET automatically
compact/compress the html before it is sent to the client browsers?

Thanks

Mark

 
Reply With Quote
 
 
 
 
Karl Seguin
Guest
Posts: n/a
 
      16th Aug 2005
Check out:
http://www.blowery.org/code/HttpCompressionModule.html

it isn't a compacter, it's a compressor

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Untitled" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Is there a component that i could use to automatically compact (remove
> white spaces, new lines maybe, etc..) the rendered HTML pages?
>
> When writing HTML, developers like to add spaces and newlines to make
> the code more readable. When a single space is added to a datagrid
> control, and this datagrid control has renders a 1000 items, this adds
> 1000 useless spaces to the HTML output.
>
> Is there any way to get arround this? To have ASP .NET automatically
> compact/compress the html before it is sent to the client browsers?
>
> Thanks
>
> Mark
>



 
Reply With Quote
 
Untitled
Guest
Posts: n/a
 
      16th Aug 2005
I think i rather use a compactor. But that's only because i don't
really understand how a compressor would work. I mean how does the
browser know to decompress the HTML output? And if it does know to do
so, how does it know what algorithm to use?

 
Reply With Quote
 
Karl Seguin
Guest
Posts: n/a
 
      16th Aug 2005
Compression is supported by HTTP. When the browser sends a request, it
tells the server which type of compression is supports (gzip or deflate).
Http compression modules (like the one I provided a link to), read this and
compress the output accordingly and tell the browser how it was compressed.
The browser then compresses it. If the browser doesn't send a header with
the type of supported compression, nothing happens. In other words, it's
baked into HTTP and the browsers. The specific module is simply a .Net
implementation for use specifically in ASP.Net projects.

It's true that the content won't always be compressed (when the browser
doesn't support it), but most modern browser do support it....and compared
to a compactor, it'll make a much bigger difference in the file size.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Untitled" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I think i rather use a compactor. But that's only because i don't
> really understand how a compressor would work. I mean how does the
> browser know to decompress the HTML output? And if it does know to do
> so, how does it know what algorithm to use?
>



 
Reply With Quote
 
Karl Seguin
Guest
Posts: n/a
 
      16th Aug 2005
blah, I re-read that and there's a bunch of writing mistakes...but you get
the idea

karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is
annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
"Karl Seguin" <karl REMOVE @ REMOVE openmymind REMOVEMETOO . ANDME net>
wrote in message news:(E-Mail Removed)...
> Compression is supported by HTTP. When the browser sends a request, it
> tells the server which type of compression is supports (gzip or deflate).
> Http compression modules (like the one I provided a link to), read this
> and compress the output accordingly and tell the browser how it was
> compressed. The browser then compresses it. If the browser doesn't send a
> header with the type of supported compression, nothing happens. In other
> words, it's baked into HTTP and the browsers. The specific module is
> simply a .Net implementation for use specifically in ASP.Net projects.
>
> It's true that the content won't always be compressed (when the browser
> doesn't support it), but most modern browser do support it....and compared
> to a compactor, it'll make a much bigger difference in the file size.
>
> Karl
>
> --
> MY ASP.Net tutorials
> http://www.openmymind.net/ - New and Improved (yes, the popup is
> annoying)
> http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
> come!)
> "Untitled" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>I think i rather use a compactor. But that's only because i don't
>> really understand how a compressor would work. I mean how does the
>> browser know to decompress the HTML output? And if it does know to do
>> so, how does it know what algorithm to use?
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does outlook render html? Ron Microsoft Outlook Discussion 1 15th Aug 2008 10:27 PM
HTML emails always render as text only (no HTML at all) captainclueless@gmail.com Microsoft Outlook Discussion 3 28th Jul 2008 06:14 PM
Getting Excel to render HTML allicynwilde@gmail.com Microsoft Excel Misc 0 27th Feb 2008 08:06 PM
Render PDF to HTML on-the-fly? Steve E. Microsoft ASP .NET 2 26th Oct 2004 06:59 PM
Control to render HTML? Christopher Ambler Microsoft Dot NET Framework Forms 2 13th Sep 2003 11:45 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:06 AM.