WordPress 自带的小工具功能,允许你自由定制侧边栏的内容,但是过多的小工具可能会导致数据库的查询增多,如果这些小工具基本不会怎么大更新的话,我们可以考虑将它们进行缓存,直接从缓存中输出,这样就可以检查数据库的查询,还可以加快网站的加载速度。
倡萌今天就推荐 Widget Output Cache 这个插件,安装启用这个插件后,默认就会缓存所有的小工具(直接缓存为html静态),当然,如果你不希望缓存其中的某个小工具,你可以在这个小工具的设置选项里面勾选排除的(该插件会自动在每个小工具设置页面插入一个排除选项):

Widget Output Cache 采用的是 WordPress transients 数据库缓存方式,也就是将所有的内容直接缓存到数据库的 options 表,然后直接读取,这样一来,就会占用一定的数据库空间来存放缓存内容,所以请记得查看你的数据库是否有足够的空间来缓存。
在后台插件安装界面搜索 Widget Output Cache 即可在线安装,或者在这里下载
来源:
https://www.wpdaxue.com/widget-output-cache.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_32630.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57