[Templates] CGI/TT vs SSI
Leo Lapworth
Leo Lapworth <leo@cuckoo.org>
Wed, 8 Oct 2003 13:16:49 +0100
On Wed, Oct 08, 2003 at 02:29:36PM +0200, Tosh Cooey wrote:
> Hi, I'm currently using a mix of static HTML and TT driven CGI.
>
> I want to streamline some things, especially using a standard menu based on
> an XML file.
The way we have it (works for us) is:
cron job
--------
generate_menu.pl
which writes out /includes/menu_section1.html
and /includes/menu_section2.html
.html pages are SSI'ed so
file.html
<html>
stuff...
<!--#include virtual="/includes/menu_section1.html" -->
</html>
Then dynamic pages ( TT root set to same as apache doc root)
.tt/.cgi
<html>
stuff...
[% IF site_section == 1 %]
[% INCLUDE "includes/menu_section1.html" %]
[% ELSE %]
[% INCLUDE "includes/menu_section2.html" %]
[% END %]
</html>
Menu's are obviously going to be hit a lot (e.g. every page)
so if you can get away with having them generated externally
and then included this should help on load.
Just incase you haven't come across it, it's always a good
idea to have a 'lite' html server (port 80) that then proxies
to a 'heave' mod_perl server (post 8080), this way the
large mod_perl process isn't handeling html / image serving,
but can still be refreshed often by generating the menu's seperatly.
- more in the mod_perl guide: perl.apache.org/docs/1.0/guide
HTH
Leo