caching=true; //Enable caching. If it is false, the cache will be invalid. $smarty->cache_lifetime=60; //Cache time, unit is 2 seconds. The usage and clearing of Smarty cache is as follows: $marty-&g"/> caching=true; //Enable caching. If it is false, the cache will be invalid. $smarty->cache_lifetime=60; //Cache time, unit is 2 seconds. The usage and clearing of Smarty cache is as follows: $marty-&g">
Home >Backend Development >PHP Tutorial >Cache application in eset smart security php smarty template engine
1. Smarty cache configuration:
Copy the code The code is as follows:
$smarty->cache-dir="directory name"; //Create cache directory name
$smarty->caching=true ; //Enable caching. When it is false, the cache will be invalid.
$smarty->cache_lifetime=60; //Cache time, in seconds
Copy code Code As follows:
$marty->display("cache.tpl",cache_id); //Create a cache with ID
$marty->clear_all_cache(); //Clear all caches
$marty->clear_cache ("index.php"); //Clear the cache in index.php
$marty->clear_cache("index.php',cache_id); //Clear the cache with the specified ID in index.php
The above introduces the caching application in the eset smart security php smarty template engine, including the content of eset smart security. I hope it will be helpful to friends who are interested in PHP tutorials.