Home  >  Article  >  Backend Development  >  smarty cache application and clearing

smarty cache application and clearing

WBOY
WBOYOriginal
2016-07-25 09:10:321047browse
1. Smarty cache configuration $smarty->cache_dir = "/caches/"; //cache directory $smarty->caching = true; //Enable caching. When it is flase, the cache will be invalid. $smarty->cache_lifetime = 60; //slow

1. Smarty cache configuration $smarty->cache_dir = "/caches/"; //cache directory $smarty->caching = true; //Enable caching. When it is flase, the cache will be invalid. $smarty->cache_lifetime = 60; //Cache time

2. Using and clearing Smarty cache $smarty->display('cache.tpl', cache_id); //Create a cache with ID $smarty->clear_all_cache(); //Clear all caches $smarty->clear_cache('index.htm'); //Clear the cache of index.tpl $smarty->clear_cache('index.htm',cache_id); //Clear the cache of the specified id



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn