Re: compact html on the fly
| From: | Andreas Pour | Date: | Wed, 02 Aug 2000 16:18:46 +0000 |
| Subject: | Re: compact html on the fly | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-9735@lists.php.net to get a copy of this message | ||
Wico de Leeuw wrote:
>
> At 10:58 2-8-00 -0400, Daniel Convissor wrote:
> >Hi Y'all:
> >
> >Andreas Pour wrote:
> > >
> > > bandwidth (which costs more than the extra CPU power to do this)
> >
> >Yep.
> >
> >
> > > (2) since a browser is supposed to ignore white space, you could get
> > > away with stripping it,
> >
> >Dude, but how much white space for formatting is there in a document compared
> >to text? Not much. If you have so much, code your HTML better.
>
> You don't line out your code? i don't want to see/change it then :)
Well, HTML is code like anything else, and when its not indented its
quite hard to debug. Since I use a lot of nested tables sometimes 30%
of the file is white space.
>
> > > (3) if the browser supports it, compress, e.g., $buffer =
> > > gzcompress($buffer) (this, BTW, can be a huge savings, converting a 100K
> > > HTML document to 10K, which means you can serve 10 times the web pages
> > > on the same bandwidth as almost all browser support this now)
>
> Anyone know how to detect if the browser supports this and to implent this?
I think
if (ereg($HTTP_ACCEPT_ENCODING, "gzip"))
start buffering
else
don't bother
Ciao,
Andreas