|
Posted by Boots on 04/17/05 01:41
Hi.
Smarty will regenerate caches if it must recompile the template. So
make sure that force_compile is off and perhaps also disable
compile_check. Remember too that when you cache a template, it observes
the lifetime that was active when it was cached, not the *current*
setting. So if you cached it with a lifetime of 300s, Smarty will
observe that 300s setting until the cache expires (or is removed) and
recached. It will then recache with whatever setting is current for
cache_lifetime.
On a side note: *please* test with a release version of Smarty
(especially when posting to smarty-general). You are very much
encouraged to use the latest release but any recent release is better
than a dev version when reporting non-testing related issues. When
posting testing related issues they should also be against a release
version and/or the current cvs HEAD and should be posted to smarty-dev.
HTH
xo boots
--- "Ashley Etchell :: Mtracking" <ash@mtracking.com> wrote:
> My code works by checking if the cached template exists using:
>
> if(
> (!$Nav->tpl->is_cached('content.html',cache_name()))) {
> if($_PCONFIG['query_f'] != '') {
> // function to return database query results
> $data = $_PCONFIG['query_f']();
> }
>
> cache_name() returns the name of the cached file, eg
>
>
> s1_l10_g1_cGlobalOverview_y200503_cid9_pageoverview_departments in:
>
>
s1_l10_g1_cGlobalOverview_y200503_cid9_pageoverview_departments^%%11^11A^11A
> 9DC5F%%content.html
>
> The cache doesn't seem to be respecting the cache life_time value of
> -1
>
>
> So no db query is performed if the template exists (in theory!) but
> this does not seem to be happening
>
>
> I am using version 2.6.5-dev
>
> Cheers
> Ash
> ________________________________________
> From: Vicente Werner [mailto:vwerner@gmail.com]
> Sent: 16 April 2005 09:29
> To: ash@mtracking.com
> Subject: Re: [SMARTY] caching files and sessions
>
> I think you're doing this at the wrong level, what you must cache is
> your
> data not the compiled templates, there're a number of php apis that
> have
> data caching abilities.
>
> Btw the problem is not ^%%11^11A^11A9DC5F%% as it's the id it adds to
> the
> file, also you haven't told us which smarty version are you using
Navigation:
[Reply to this message]
|