I hit send too soon by mistake!
Monte Ohrt wrote:
> Just a reminder, there is a wonderful book written long ago that covers
> Smarty caching. It's called the manual, and it's full of explanations
> and examples 
>
> http://smarty.php.net/manual/en/caching.php
>
> Not to mention tons of threads in the forums and wiki pages re-iterating
> this information in detail. I'm sure the new book has useful information
> too, but I'm curious, what is left out that creates this chicken-egg
> delima?
the fact that I don't understand the manuals in so far as the concepts/functionality
of compiling/caching. - or at least I don't see how I can extrapolate the
examples to a level of complexity where I can implement the functionality into
my 'system'.
for instance there are a few lines of code on this page:
http://smarty.php.net/manual/en/cach...ple.caches.php
if(!$smarty->is_cached('index.tpl',$my_cache_id)) {
// No cache available, do variable assignments here.
$contents = get_database_contents();
$smarty->assign($contents);
}
but I have data coming from various sources - injected into the *templates*
(which are often nested) at various places (using various subclasses and
delegate classes for/of the Smarty class) on top of which there are various
a load of plugin functions that retrieve data all on their own (no input
fom the calling scripts) - and pretty much all of this is conditional based on
reuqest and/or session variables. oh and there are quite alot of places where
certain bits of content must be completely dynamic (recalculated on each request
- on a per user basis) even when the gross of the page could actually be cached
because it doesn't change on every request.... lastly I like my caching functionality
to be completely generic so that it's reusable accross all the sites that the
codebase in question is used on (a number of 'big' clients) and the implementing it
on each site doesn't require reams of additional code in my frontend|page scripts.
now just writing that made my head spin ;-)
hopefully you see that it's not your docs at fault so much as I have got a
rather complex codebase and I'm finding it:
a, hard to fully understand the compiling/caching paradigm in smarty per se
and
b, harder still to take the examples in the docs and extrapolate the concepts
into a design for flexible,generic production quality caching mechanism which
i can actually implement (and would work: in terms of the clients' requirements
for dynamic content - i.e. that 'truely' dynamic stuff doesn't get cached, etc).
regards,
Jochem.
>
> Monte
>
> Jochem Maas wrote:
>
>>
>> caching groups. (does that even exist or am I confused?)
>> [complex] conditional caching.
>> caching pages where parts of the page needs to stay completely
>> dynamic.
>>
>> It's difficult to describe what I mean because of the fact that
>> I don't grok the smarty cache functionality - bit of a chicken 'n' egg
>> problem - although what you mention sounds like it could do me some good
>> to read....
>>
>> thanks for the feedback.
>>
>