Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Get timestamp of cached file (V3)

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
fernandoo
Smarty n00b


Joined: 25 Apr 2016
Posts: 2

PostPosted: Mon Apr 25, 2016 8:16 pm    Post subject: Get timestamp of cached file (V3) Reply with quote

Hi, i'm trying to get the cache timestamp with this command like in V2:

$tpl->cached->timestamp

But it's not working. How can i get this working in Smarty V3??

Thank you
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Tue Apr 26, 2016 1:53 am    Post subject: Reply with quote

You don't need to know that.
Back to top
View user's profile Send private message
fernandoo
Smarty n00b


Joined: 25 Apr 2016
Posts: 2

PostPosted: Tue Apr 26, 2016 7:41 am    Post subject: Reply with quote

So, how could i know if the cache is older than new data in DB?

I wan't to compare the timestamp from the cache with the timestamp from last change in DB
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Wed Apr 27, 2016 12:57 pm    Post subject: Reply with quote

You don't need to know that.
When the data in the DB is updated, you should invalidate cache.
Or set cache time short enough to make the time of desync insignificant.

(I have cache times set to 6 hours on most blocks. More than enough for mostly static content. The page content is cached for the same time, but it is invalidated when a new version of the page is saved to the DB.)
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP