Click here to get back home

Don't bother saving white-space

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Don't bother saving white-space Stephen Poley 08-19-2004
Posted by Stephen Poley on August 19, 2004, 9:49 pm
Please log in for more thread options
People in these groups, and on web-pages, not infrequently suggest that
it is worthwhile cutting down on white-space and comments in HTML and
CSS in order to reduce loading times. I and others have more than once
doubted this, given the data-compression in the HTTP protocol. Having
seen it suggested again a couple of times in the last few days, I
decided it was time for a test on the effect of white-space.

I took one of my pages:
http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
which is 20 Kb.

I then bloated it with whitespace to 162 Kb (nothing special about that
number - it's just what it happened to end up as):
http://www.xs4all.nl/~sbpoley/misc/checklist.html

I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
ask - I don't know either) using Opera 7.

The first page loads in 3 seconds, the second in 8 seconds - both
figures seem to be repeatable. This suggests that if you took a file
with a fairly generous 5Kb of white-space, and stripped out all of it,
loading would be speeded up by a princely one-sixth of a second. (For
comparison, the largest HTML file on my site, of 79Kb, turned out to
have just under 3Kb of compressible white-space.)

Somehow it just doesn't seem worth it ...

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Posted by Neal on August 19, 2004, 4:00 pm
Please log in for more thread options
On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley

> People in these groups, and on web-pages, not infrequently suggest that
> it is worthwhile cutting down on white-space and comments in HTML and
> CSS in order to reduce loading times. I and others have more than once
> doubted this, given the data-compression in the HTTP protocol. Having
> seen it suggested again a couple of times in the last few days, I
> decided it was time for a test on the effect of white-space.
>
> I took one of my pages:
> http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
> which is 20 Kb.
>
> I then bloated it with whitespace to 162 Kb (nothing special about that
> number - it's just what it happened to end up as):
> http://www.xs4all.nl/~sbpoley/misc/checklist.html
>
> I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
> ask - I don't know either) using Opera 7.
>
> The first page loads in 3 seconds, the second in 8 seconds - both
> figures seem to be repeatable.

For me, original=3secs, bloated=21 secs.

The extra white space amounts to 142 Kb. Took me 18 extra seconds to load.
About 8Kb per sec, or close to the same for the original file. This would
seem to indicate there is value in reducing white space.


Posted by Nick Kew on August 19, 2004, 9:47 pm
Please log in for more thread options

>> People in these groups, and on web-pages, not infrequently suggest that
>> it is worthwhile cutting down on white-space and comments in HTML and
>> CSS in order to reduce loading times. I and others have more than once
>> doubted this, given the data-compression in the HTTP protocol. Having

Compression is optional in HTTP, and only works if you've enabled it
on the server (eg with mod_deflate).

>> http://www.xs4all.nl/~sbpoley/webmatters/checklist.html
>> which is 20 Kb.

HTTP compression is not enabled on that URL.

>> I then bloated it with whitespace to 162 Kb (nothing special about that
>> number - it's just what it happened to end up as):
>> http://www.xs4all.nl/~sbpoley/misc/checklist.html

Nor there.

>> I tested them over my 46 Kbps modem connection (yes: 46, not 56; don't
>> ask - I don't know either) using Opera 7.

I expect you have PPP compression enabled in your modem.

>> The first page loads in 3 seconds, the second in 8 seconds - both
>> figures seem to be repeatable.

That's a significant difference. If you had HTTP compression enabled there
should be negligible difference (because that extra 162K would be wiped out).

> For me, original=3secs, bloated=21 secs.

Either you have no PPP compression (very bad), or you have a bottleneck
elsewhere in your connection.

> About 8Kb per sec, or close to the same for the original file. This would
> seem to indicate there is value in reducing white space.

Indeed, in some circumstances there is. But there is much more value
in mod_deflate. And if you use that, the value in reducing whitespace
vanishes. That applies to any repetitive patterns - such as HTML tags -
but not to comments (mentioned in passing in the OP).

--
Nick Kew

Nick's manifesto: http://www.htmlhelp.com/~nick/


Posted by Stephen Poley on August 19, 2004, 10:39 pm
Please log in for more thread options

>On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
>
>> The first page loads in 3 seconds, the second in 8 seconds - both
>> figures seem to be repeatable.

>For me, original=3secs, bloated=21 secs.
>
>The extra white space amounts to 142 Kb. Took me 18 extra seconds to load.
>About 8Kb per sec, or close to the same for the original file. This would
>seem to indicate there is value in reducing white space.

That's interesting. I wonder what causes the difference? What browser
are you using? Are you using a 56Kb modem? - if so, it indicates that it
must be doing some compression, or the 'bloated' transmission would take
around 30 seconds.

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/


Posted by Neal on August 19, 2004, 4:48 pm
Please log in for more thread options
On Thu, 19 Aug 2004 21:39:41 +0200, Stephen Poley

>
>> On Thu, 19 Aug 2004 20:49:58 +0200, Stephen Poley
>>
>>> The first page loads in 3 seconds, the second in 8 seconds - both
>>> figures seem to be repeatable.
>
>> For me, original=3secs, bloated=21 secs.
>>
>> The extra white space amounts to 142 Kb. Took me 18 extra seconds to
>> load.
>> About 8Kb per sec, or close to the same for the original file. This
>> would
>> seem to indicate there is value in reducing white space.
>
> That's interesting. I wonder what causes the difference? What browser
> are you using? Are you using a 56Kb modem? - if so, it indicates that it
> must be doing some compression, or the 'bloated' transmission would take
> around 30 seconds.
>

Opera 7.23 on dialup 56k, 45333 bps.


Similar ThreadsPosted
Whitespace and html August 15, 2006, 1:18 pm
Auto remove whitespace from HTML April 14, 2008, 2:23 am
Gaps caused by whitespace: solutions without changing HTML code? May 19, 2006, 1:36 pm
notepad not saving .html September 11, 2004, 7:47 pm
Saving a web page without the graphics January 23, 2005, 4:52 pm
How to do this in MSIE: saving a GIF image which was generated on-the-fly October 15, 2004, 2:48 am
Saving HTML Form without Submit December 8, 2005, 4:23 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap