On Tue, 31 Jul 2001, Perrin Harkins wrote:

> Would it?  Your data is cached by your objects, right?  It seems like this
> won't actually help you unless you move the caching out of the objects and
> into the templates, which probably isn't what you want if you reuse these
> objects on multiple templates.

I can't speak for the CitySearch team, but at PETsMART, we use a very
similar approach, including the lazy-loading objects.  However, not all of
our generated output is from the data objects.  For example, many of the
data structures specify include files to be parsed into the generated
file.  It would be very helpful to be able to cache these includes in a
flexible manner.  

At an even higher level, it would be extremely useful to be able to cache
some of the processed templates like this:

[%- cache.include (
        template => 'includes/spine', 
        key => section.category_section.section_id, 
        expires => 3600
    ) 
-%]

What this syntax would allow is caching specific templates based on some
key value which specifies a unique rendition of the template.  This would
reduce a lot of the work that I have to redo, while still preserving the
flexibility to process things over and over again if necessary.

++t

Tony Payne  :  Sr. Software Engineer  :  PETsMART.com  :  626-817-7151



Reply via email to