Hello,

It might be a better idea to "compress" the templates when you deploy the
application rather than compress each call to output() at runtime. It's true
that you could miss some opportunities for compression in the values that
populate the template at runtime, but that's only significant if you're
adding big
fragments of html using the templates.

* Method:
Create 2 directories:
.../templates-source     where you put the templates
.../templates-deployed   where templates are included from

Each file in templates-source is read through HTML::Clean in turn,
producing a corresponding file of the same name in templates-deployed.
(This should leave the original in templates-source unchanged, for safety.)
The web app only uses the compressed templates from templates-deployed.

* Caveat:
You have to ensure that TMPL_.... elements in the source survive the
compression process intact.

* Result:
Leaner web pages but without the overhead of running HTML::Clean
for each HTTP request.

If you're using templates to add pure data values this should provide
most of the savings you'd get from using HTML::Clean on the result of
applying HTML::Template.

Just a thought,

Dafydd Rees

PS. Many thanks to Sam Tregar and others for making perl web applications
cleaner and simpler.

----
Dr. Dafydd Ll. Ll. Rees
www.dafydd.net
tel: 07968 486 880


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to