Skipping Template Toolkit

Ovid on 2002-12-17T23:10:19

We have a site that has many common elements, so there were some suggestions to use Template Toolkit. The programmer working on the pointed out that very little of the site is dynamic, so Template Toolkit didn't seem to offer any advantages over server side includes. Today, I find myself in the process of making these changes while that programmer is on vacation. I went into Apache's httpd.conf and enabled the includes (first time I've ever done that) and am now writing scripts to automate stripping out the common HTML (identified by hand), replacing it with the appropriate SSI and rename all of the pages with .shtml extensions. It makes a nice change of pace from a lot of the database driven stuff that I do.


static content

gnat on 2002-12-18T17:42:01

You can use TT to prepare static content as well. A lot of people use server-side includes to assemble pages of static content (navbar here, disclaimer there, etc.). Having your httpd look at the HTML files instead of simply sending them back consumes cycles. A lot of sites preprocess their HTML--an offline make install type process builds the static content from the components. Template Toolkit can definitely do this.

--Nat

Re:static content

Dom2 on 2002-12-18T18:13:49

Also, it renders your content deliverable by the sendfile(2) system call, which really speeds things up in terms of delivery.

Anbother thing with a "make install" type of system is that you can prepare pre-gzipped content for mod_gzip in order to save yourself bandwidth.

-Dom

Re:static content

matti on 2003-02-05T22:39:20

Any examples around of a makefile for this kind of setup?

not the dreaded .shtml

gav on 2002-12-18T23:31:49

I'm against .shtml because it's a pain if you ever want to move away from SSI.

Using XBitHack is nicer plus it allows caching to work better.