[thelist] ASP/CGI/PGP/COLDFUSION & DOCTYPE declaration

Andrew Forsberg andrew at thepander.co.nz
Sat Mar 9 16:21:01 CST 2002


>Am I being 'paranoid' when I
>see the html cranked out looks like it's been through a garbage disposer?
>No Linebreaks, no tabs is what is commonly seen. Php has absolutely
>fabulous functions to format clean html. My first scripts were....well. Awful.
>
>I'd like to hear from others experiences, if they use DTD's and take care
>in having clean, legible,  source output, or if you feel
>it's overkill.

Hi

Until 6 months ago I'd have agreed re: whitespace. Then one site
started hitting 15 to 21 gb a month in traffic, and would peak at
several requests per second. (Heck, it's for what I thought was a
limited NZ community of enthusiasts.) Cue: frantic search for a
hosting agreement without traffic charges before the client freaks.

By stripping tabs, spaces, line breaks and comments everywhere they
weren't absolutely necessary for separating larger chunks of code in
the output, the size of the html ouput was trimmed down considerably
(about 5% to 7%). The php code is still legibly formatted, but the
html looks quite like a nightmare from a human-readable p.o.v. It
still has an xml declaration, doctype, and it validates (unless a
user's post stuffs it for a specific page).

In this case there were two factors more important than nice looking
output code: speed, and decreasing traffic to an already busy host.

Cheers
Andrew

--



More information about the thelist mailing list