Smarty1

Smarty的缓存机制

  1.Smarty的缓存机制默认是不开启的,需要开发人员自己开启;Smarty编译默认是开启的

  2.缓存是一种思想,不要刻意使用,缓存机制的根本原理是:通过空间换时间

  3.清除缓存的方法

    ①$smarty->clear_all_cache()

    ②$smarty->clear_cache('file.tpl')

    ③$smarty->clear_cache('file.tpl',$art_id)        //清除同一个模板下的指定缓存号的缓存

  4.一个模板,多个缓存

    $smarty->display('article.tpl',$art_id)

  5.局部缓存:insert

posted @ 2014-11-09 19:40  流白荒芜了我的时光  阅读(132)  评论(0)    收藏  举报