> 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.
My assumption ("6:15, re-state my assumptions...") is that processing
templates is cheap, while fetching data is expensive. If the data is
already cached, it shouldn't matter how many files you include. If the data
isn't cached, you can't skip processing the files anyway.
The reality is that processing templates could be faster, even with cached
data, but we'll leave that to TT3.
> 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
> )
> -%]
Well, my cheesy little plugin does that much.
> 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.
If your objects cache their data lookups, you would still only save the cost
of processing the template directives, i.e. not much. If they don't cache
their data, then I could see this making a big difference.
- Perrin