For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > July 2004 > Re: [SMARTY] How to get cache build time on cached template?









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] How to get cache build time on cached template?
Messju Mohr

2004-07-27, 4:03 pm

On Tue, Jul 27, 2004 at 10:31:57AM +0200, Erik Franzén wrote:
> Is there a neat way to find out about the cache build date (time) for a
> cached template in Smarty?


if you want to do it you have to dig into smarty's internals and
reverse engineer how the files are stored inside the cache folder (you
arent't save for any changes in furture versions then, of course).

or you can implement your own $smarty->cache_handler_func: when you
stored the files yourself (via your cache_handler_func) you may be the
best to know their creation times.

but normally you don't need the creation-times of cached pages. you
just set an expiration-time and ask via is_cached() if the cached page
is too old.

greetings
messju

> /Erik
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Vonleigh Simmons

2004-07-27, 4:03 pm

>> Is there a neat way to find out about the cache build date (time) for[color=darkred]

I'd just make note of the time before I called display (pseudo code
because I have to run):

If ( smarty isn't cached ) {

// whatever your script does
....
// make note of time and date into a database or file
}

smarty->display();


Vonleigh Simmons
<http://illusionart.com/>
Sponsored Links







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

Copyright 2008 codecomments.com