discuz关闭缓存

发布时间 2023-10-06 20:57:30作者: ingemar,fang

修改 function_core.php 文件

vim discuz_x3.2/upload/source/function/function_core.php

代码如下,添加红色字体

登录后复制
function checktplrefresh($maintpl, $subtpl, $timecompare, $templateid, $cachefile, $tpldir, $file) {
  static $tplrefresh, $timestamp, $targettplname;
  if($tplrefresh === null) {
  $tplrefresh = getglobal(‘config/output/tplrefresh’);
  $timestamp = getglobal(‘timestamp’);
} //关闭缓存
if(1 || empty($timecompare) || $tplrefresh == 1 || ($tplrefresh > 1 && !($timestamp % $tplrefresh))) {
  if(1 || empty($timecompare) || @filemtime(DISCUZ_ROOT.$subtpl) > $timecompare) {
    require_once DISCUZ_ROOT.’/source/class/class_template.php';
    $template = new template();
    $template->parse_template($maintpl, $templateid, $tpldir, $file, $cachefile);

后台更新缓存

后台管理 ——》工具 ——》 选择更新缓存

此处仅仅是更新缓存,无法删除缓存

 

后台设置缓存

后台管理 ——》 全局 ——》 性能优化 ——》 内存优化 ——》 ”内存优化功能设置“ ——》 ”关闭“缓存一些功能

 后台管理 ——》 全局 ——》 性能优化 ——》 论坛页面缓存设置 ——》 ”缓存系数“ ——》 设置为”0″,关闭缓存

删除缓存文件

上图中,显示了缓存文件在“data/threadcache/” 目录下,因此登陆服务器,用控制台删除缓存文件