|
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 |
roger Smarty Rookie
Joined: 23 Jan 2011 Posts: 19
|
Posted: Sun Jan 23, 2011 9:58 am Post subject: [Résolu]Aide sur isCached par rapport à un timestamp |
|
|
Bonjour à tous.
Je découvre à peine Smarty 3 et je n'arrive pas à renouveler les caches selon un temps donné.
Je m'explique:
Je veut que les caches ne soient renouvelés que lorsque j'ai mis un catalogue à jour.
J'ai le timestamp de la mise à jour du catalogue et au besoin celui de la prochaine mise à jour.
Ma question:
Comment faire avec isCached qui ne prend qu'un temps donné par rapport à time() ?
Si une âme charitable passe par là !!!
Cordialement.
Bon j'ai trouvé, il suffit juste de savoir et la doc n'est pas très explicite.
Il faut mettre $caching = CACHING_LIFETIME_CURRENT et pas CACHING_LIFETIME_SAVED
$Smarty->setCaching(Smarty::CACHING_LIFETIME_CURRENT);
Et $cachelifetime HEURE ACTUELLE moins DERNIERE MISE A JOUR DU CATALOGUE
$Smarty->setCacheLifetime(time()-$last_update); |
|
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
|