[Zope] TAL page whitespace removal
Robert (Jamie) Munro
jamie at textmatters.com
Wed Apr 12 14:03:29 EDT 2006
Dieter Maurer wrote:
> Robert (Jamie) Munro wrote at 2006-4-10 13:14 +0100:
>> ....
>> For example, I downloaded the www.plone.org home page and it was 47704
>> bytes. I removed all whitespace from the beginning and end of lines, and
>> then removed blank lines, and it was down to 35087 bytes - that's a more
>> than 25% saving, and the output renders exactly the same in web
>> browsers.
>
> A much more efficient way is to activate "gzip" compression
> for your pages. It not only handles white space efficiently
> (and correct for e.g. pages with "pre" tags or similar CSS directives)
> it also compresses other text. You not only gain 25 % but about 70 %
> (in the size of requests).
gzip will add enormous processing overhead to the server. Striping
spaces will add negligible overhead, likely less overhead than it saves.
> You will not save RAM on the server side (of course), but
> hopefully (and very likely) the scripts are not the major
> user of RAM on your site.
I have written TAL that produces very large dumps of XML data in the
past, even whole sites. It's a really nice way to dump data from a
database (SQL or Zope DB), but Zope has to build the whole output in RAM
before sending any of it, so it can cause the site to crash. I would
hope in this kind of case that the TAL is the major user of RAM on the
site, so any saving would be really good, but it all cases (except <pre>
tags, which I would never use) it seems like a possibly significant gain.
Robert Munro
More information about the Zope
mailing list