why unix | RBL service | netrs | please | ripcalc | linescroll
hosted services

hosted services

    Template Attribute Language or TAL is a great way to author pages. First a little writing of efficiency.

    I'm not the biggest expert on prompt delivery of page content. However, what I can tell you is that PHP/Perl or any other CGI that has to execute to deliver data over HTTP is not going to be as efficient as sending a single file that is already on disk. This is the point of HTTP disk caches. Many people have tried to couple dynamic page delivery with caches.

    In most PHP blogs you end up with an execute path much like this:

      +-------+
      | httpd |
      +---+---+
          |
          V
       +--+--------+
       | libphp.so |
       +---+-------+
           |
           |
       +---+---+
       | mysql |
       +-------+
    

    Some clever people realised that there were many lookups to the database for each request and decided to couple PHP with memcache to store objects in memory rather than performing the expensive lookups for every request.

    So things look like this now

      +-------+
      | httpd |
      +---+---+
          |
          V
       +--+--------+          +-----------+
       | libphp.so +---+----->| memcached |
       +---+-------+   |      +-----------+
           |           |
           |           |      +-------------+
       +---+---+       +----->| accelerator |
       | mysql |              +-------------+
       +-------+
    

    Which is fine, so we now have the HTTP disk cache, the mysql memory cache and memcache. Quite a bit of overhead. There's the accelerator too which caches objects and attempts to avoid the parsing exercise, among other things.

    Why is this needed when content rarely changes? Well it's not.

    Thankfully Colin Stewart made a nice program called pubtal which generates pages from plain text against a TAL file. Whilst for those small parts of the site that must be dynamic there's petal which does a similar job from a template file which keeps a consistent look and feel for your site.

    Sales pitch over ;)