On Fri, 16 Nov 2001, Roland Lammel wrote: > It may be possible to cache the modification-dates of the templates at > compile time, and just check againt file-size and mtime.
Oh, I'll definitely be checking mtimes for the main template file. All that takes is a simple "mtime(template) <= mtime(cache_file)". The issue is whether I can also check the mtimes of included files. I've thought about it some and I think I can but it won't be in the first version. > If a file has been modified, it might be wise to fork a backgound process, > which compiles the template, and still serves the old template until > the new one is compiled (and moved over the old comp. template) I don't think that will work in most cases. Imagine that the change added a <tmpl_var> and that die_on_bad_params is on. When they call $template->param(new_param => 'foo') the stale cached template object will die! The problem is that a template doesn't exist in a vacuum - if it's been changed and "no_compile" isn't set then the module can only assume that the new version is needed immediately. One possiblity would be to provide a mode that falls-back to normal HTML::Template behavior on cache-miss rather than compiling a new version. -sam --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
