On Sun, 06 May 2001 07:07:19 GMT, Geert Poels 
    <[EMAIL PROTECTED]> somehow managed to type:
>hi,
>
>I wanted to know if any official W3 or browser-developer document/spec
>mentions a (recommended) limit to the line length of an html page ?

I don't believe that any mention a limit.

>Can I safely use an html-compressor, putting all fe. 50000 bytes of a
>page on a single line ?

I wouldn't.

Most web browsers would read your web-page as a stream of bytes, rather
than line by line. A newline would just be another character to process
in the stream, and asking how often you should put in a newline becomes
as meaningful as asking how often you should use the letter 'Q'.

That said, web browsers aren't the only things that read web-pages. You
should also try to be kind to bots and scripts that may have far more
primitive parsers. For example, a lot of Perl programmers would use the
diamond operator to pull in the page line by line, so having 50k lines
would be unfriendly.

Similarly, anyone choosing "View Source" on your webpage could be in for a
nasty shock. Many text editors/viewers aren't particularly kind to lines
that are 50k characters long.

One writer of an "HTML optimizer" claims the average gain you get by
removing unnecessary whitespace and comments from HTML is around 10% of
the original file-size. This sounds good, but consider it further - the
front page of www.cnn.com (a pretty big page) is 58,590 bytes. Cutting
10% off this will speed up page loading by a tad under two seconds on a
33.6k modem.

The total size of the page, however, including graphics is 176,482. This
is pretty typical, the page isn't particularly graphics-rich. Your 10%
bandwidth saving has just become 3%, and your two seconds saving out of
twenty, has just become an unnoticeable two seconds out of approximately a
minute.

Leave the newlines be. They're not doing you any harm. :)

Charles Miller

Reply via email to