For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > April 2005 > RE: [SMARTY] caching files and sessions









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author RE: [SMARTY] caching files and sessions
Ashley Etchell :: Mtracking

2005-04-16, 3:59 pm

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_p
ageoverview_departments in:

s1_l10_g1_cGlobalOverview_y200503_cid9_p
ageoverview_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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com