Re: [SMARTY] cache date and time

From: Date: Wed, 05 Jun 2002 14:07:20 +0000
Subject: Re: [SMARTY] cache date and time
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-4619@lists.php.net to get a copy of this message
Smarty would have to be changed to provide it as part of the $smarty variable, or stored as a property of the Smarty object (maybe as part of _cache_info?). I tried hacking it in where the other _cache_info was loaded but it was apparently not in scope for a prefilter at that point. (I was doing this several months ago, and gave up and moved on to other things). The way I intended to use it was for debugging. I had an application that cached a bunch of "boxes" that used the same template, but different cache lifetimes and cache ids. I wanted to display when a particular box was cached and with what cache id in an HTML template using a pre-filter. I eventually worked out all my bugs and was happy with the caching scheme, but I still think the functionality described above would be useful. To implement, I would need the time the prefilter is applied to have access to the current time (easy) and the cache_id (should not be too tough). My problem is different from the source of this thread which wanted access to the time the template was actually cached in the php script calling the template. Thanks. Jason --- Monte Ohrt <monte@ispi.net> wrote: > How would you get the cache id? You need that to get > the cache in the > first place. > > Jason Sweat wrote: > > I voted for this a while back and received no > response > > ;) > > > > > http://marc.theaimsgroup.com/?l=smarty-dev&m=102008682828760&w=2 > > > > I would like to have access to both the cache > > timestamp and the cache id for debugging purposes. > > > > Jason > > > > > > Smarty goes on the assumption that if you use the > > built-in cache, then > > you are respecting the cache_lifetime setting for > that > > cached file. So > > you wouldn't really be a need to get the timestamp > in > > this case. I'm not > > sure if timestamp retrieval is something useful to > > very many people. > > Thoughts? > > > > As a workaround, you can extend the Smarty class > and > > add your timestamp > > retrieval function, or create a custom cache > handler > > (which may be > > overkill for your need) > > > > Mattia Wow wrote: > > > >>Hi! > >>I want to chack the cache creation date of a > cached > >>file. > >> > >>It looks i can only check if the file exists > >>with > >> > >>if( $smarty->is_cached("index.tpl",$id) ) { ... } > >> > >>But I would like to get the last modification time > > > > of > > > >>the cached copy, to check if the datas in my db > are > >>fresher than those, and I must regenerate the > page. > >> > >>Tia > >>Mattia > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! - Official partner of 2002 FIFA World Cup > > http://fifaworldcup.yahoo.com > > > > > > -- > Monte Ohrt <monte@ispi.net> > Director of Technology, ispi Inc. > __________________________________________________ Do You Yahoo!? Yahoo! - Official partner of 2002 FIFA World Cup http://fifaworldcup.yahoo.com

« previous php.smarty.general (#4619) next »