找回密码
 注册
搜索
免费空间 免费域名 免费AI 老牌主机商首月仅1美分!27美元/年!Spaceship优惠码 Namecheap优惠码阿里云2核2G3M新老续费同享99元/年!
查看: 338|回复: 6

[建站交流] 右下角 Redis On怎么弄的?

  [复制链接]
发表于 2024-5-19 15:45:45 | 显示全部楼层 |阅读模式
本帖最后由 jason 于 2024-5-24 22:22 编辑

wp开了缓存插件,0查询还得0.4秒。到不了0.02秒

插件开不开没啥区别


  1. <!-- 25 queries in 0.485 seconds -->
复制代码






发表于 2024-5-19 23:54:04 | 显示全部楼层
安装其他版本的也这样吗?
发表于 2024-5-20 09:17:13 | 显示全部楼层
  1. function timer_start() {

  2.   global $timestart;

  3.   $mtime = explode( ' ', microtime() );

  4.   $timestart = $mtime[1] + $mtime[0];

  5.   return true;

  6. }

  7. timer_start();

  8. function timer_stop( $display = 0, $precision = 3 ) {

  9.   global $timestart, $timeend;

  10.   $mtime = explode( ' ', microtime() );

  11.   $timeend = $mtime[1] + $mtime[0];

  12.   $timetotal = $timeend - $timestart;

  13.   $r = number_format( $timetotal, $precision );

  14.   if ( $display )

  15.     echo $r;

  16.   return $r;

  17. }
复制代码

  1. <?php echo '耗时:',timer_stop(), 's';?>
复制代码


这是typecho的执行时间
发表于 2024-5-20 22:11:42 | 显示全部楼层
dz后台开启Redis缓存,当然你服务器也要启用了Redis才行。
发表于 2024-5-24 21:59:57 | 显示全部楼层
首先需要在php上安装redis扩展,并开启,然后找一个wp的优化插件,Object Cache Pro 可以很轻松的胜任,Object Cache Pro 是付费插件,不过有开心版。
 楼主| 发表于 2024-5-24 22:22:26 | 显示全部楼层
reishi 发表于 2024-5-24 21:59
首先需要在php上安装redis扩展,并开启,然后找一个wp的优化插件,Object Cache Pro 可以很轻松的胜任,Obj ...

好像redis开不开没啥区别,用wp-super-cache生成,注释里也是显示0.02秒。
发表于 2024-5-24 23:22:59 | 显示全部楼层
jason 发表于 2024-5-24 22:22
好像redis开不开没啥区别,用wp-super-cache生成,注释里也是显示0.02秒。

如果你用宝塔或其他的免费主机,redis很多都是开启了的,可以从phpinfo中看到。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|免费吧论坛

GMT+8, 2024-9-8 10:15 , Processed in 0.026157 second(s), 3 queries , Redis On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表