WordPress内容的获取是要读取数据库的,对数据库的请求次数越多,不仅会拖慢网页的加载速度,也会增加服务器的压力,所以我们应该减少对数据库的请求,倡萌推荐WordPress数据库缓存插件:DB Cache Reloaded Fix。
DB Cache Reloaded Fix 是在 DB Cache Reloaded 的基础上修正而来,主要是为了适用于新版WordPress。插件使用很简单,上传DB Cache Reloaded Fix 插件到plugins目录,启用后,需到插件设置页面选择启用该插件,其它可以不用动。

启用插件后,会自动在wp-content目录创建tmp缓存文件夹和db-config.ini及db.php三个文件,当你删除插件时也会随之消失。
DB Cache Reloaded Fix 下载地址:https://wordpress.org/extend/plugins/db-cache-reloaded-fix/
另:如果你需要在网站上显示数据库查询次数与响应时间,你可以在主题中添加下面的代码:
<?php echo get_num_queries(); ?> queries in <?php timer_stop(3); ?> seconds |
<?php echo get_num_queries(); ?> queries in <?php timer_stop(3); ?> seconds
倡萌推荐 DB Cache Reloaded Fix 和 Hyper Cache 一起使用,效果最佳!
来源:
https://www.wpdaxue.com/db-cache-reloaded-fix.html
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_33813.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57