thinkphp清除缓存

前台
 1 //清除缓存
 2 $(function(){
 3     $("#cache").click(function(){
 4         layer.confirm('你确定要清除缓存吗?', {icon: 3, title:'提示'}, function(index){                   
 5             $.getJSON("{:U('Sys/clearRuntime')}",function(data){
 6                 if(data.status == 1){
 7                     layer.msg(data.info,{icon:1});
 8                     
 9                 }else{
10                     layer.msg(data.info,{icon:4});
11                 }
12         
13             });
14             layer.close(index);
15         })
16     });      
17 });
后台
1 //删除缓存
2 public function clearRuntime() 
3 {          
4     delFileByDir(APP_PATH.'Runtime/'); 
5     $this->success('删除缓存成功!');
6 }
原文地址:https://www.cnblogs.com/zsczsc/p/7200954.html