[Catalyst] V::TT dynamic --> truly static

apv apv at sedition.com
Sat Oct 15 23:58:11 CEST 2005


I'm trying to set up an application that has the best of both words: 
serve initial requests for a resource dynamically but write the viewed 
page out to a file so that all subsequent requests for the file get a 
real file and don't bother the Catalyst dispatcher at all. To update a 
page that gets out of sync with data, just delete the file and it will 
get rewritten on the next request.

I'm setting it up via Apache to check for file existence and if it's 
not found, pass the request to Catalyst.

   RewriteEngine on
   RewriteCond %{REQUEST_FILENAME}   !-f
   RewriteRule ^(.+)$         /index.pl [L]

So, that's all well and good but how should I (how would you) do the 
Template part of writing the file out? I've done this in the past from 
within TT with things like this snippet:

  [[ FILTER redirect( file ) ]]
     [[ INCLUDE 'page-wrapper'
        article = art.name ]]
  [[ END ]]

Would it be wise to keep it in the template files or move it somewhere 
into the View? Has anyone tackled this already?

Thank you!
-Ashley




More information about the Catalyst mailing list