|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
fernandoo Smarty n00b
Joined: 25 Apr 2016 Posts: 2
|
Posted: Mon Apr 25, 2016 8:16 pm Post subject: Get timestamp of cached file (V3) |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Apr 26, 2016 1:53 am Post subject: |
|
|
You don't need to know that. |
|
Back to top |
|
fernandoo Smarty n00b
Joined: 25 Apr 2016 Posts: 2
|
Posted: Tue Apr 26, 2016 7:41 am Post subject: |
|
|
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 |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed Apr 27, 2016 12:57 pm Post subject: |
|
|
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 |
|
|
|
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
|