[Templates] Cache compiled templates.

Chris Winters chris@cwinters.com
29 Mar 2002 09:30:28 -0500


On Thu, 2002-03-28 at 08:34, Alexei V. Alexandrov wrote:
> Hello everyone,
> 
>  I have subclassed Template::Provider to fetch templates from a
>  database source, now i`m working on providing cache mechanism to
>  cache the compiled templates. The question is very simple: i would
>  like to use BerkeleyDB as a cache storage and was thinking about the
>  performance. Will caching to a storage different from file cache will
>  increase performace? Or is it better to cache the real template output than
>  the compiled one? Has anyone done some sort of investigations on this matter?

Off the top of my head, the only way I'd see it making an increase in
performance is if you have thousands (!) of cached templates in the same
directory, since this might slow down your filesystem.

Personally, I'd just rely on the file-based storage until you run into a
problem, since filesystems and operating systems are very smart about
keeping most-recently used files in memory.

Chris
 
-- 
Chris Winters (chris@cwinters.com)
Building enterprise-capable snack solutions since 1988.