|
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 |
gtraxx Smarty Regular
Joined: 08 Jan 2008 Posts: 56
|
Posted: Tue Dec 13, 2011 9:06 am Post subject: Configuring and using the smarty cache |
|
|
Hello, I consulted the documentation of the system cache.
I do not understand how to set it to exclude the dynamic data from mysql
Example :
Code: |
$smarty->setCaching(Smarty::CACHING_LIFETIME_SAVED);
if(!$smarty->isCached('movies/kind/record.phtml')) {
$smarty->assign('m_k_name',$data['m_k_name'],true);
$smarty->assign('m_k_desc',$data['m_k_desc'],true);
}
$smarty->display('movies/kind/index.phtml');
|
This code works in the first loading, once the page reloads my dynamic data no longer appears
my config in smarty:
Code: | /**
* compile (true/false)
*/
$smarty->compile_check = true;
/**
* Force compile
* @var void
* (true/false)
*/
$smarty->force_compile = false;
/**
* caching
*/
$smarty->caching = true;
/**
* cache lifetime
* @var $cache_lifetime
*/
$smarty->cache_lifetime = 3600;
/**
* Use sub dirs (true/false)
*/
$smarty->use_sub_dirs = false;
/**
* cache_dir -> cache
*/
$smarty->cache_dir = self::$server_root.'/caching/var_cache/'; |
|
|
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
|