注意事项
使用该缓存后可能会导致大部分插件及其功能失效
项目地址
配置说明
- 在插件/usr/plugins/目录下新建SaHtmlCache文件夹,并将Plugin.php上传到里面
- PHP.ini环境配置文件要改一下,将allow_url_include = On
- 永久链接(伪静态)设置为/{cid}.html (默认是{cid}.html,如需其他请自行更改Plugin.php)
- 在将/usr/plugins/SaHtmlCache文件夹下新建cache目录,并设为可读可写
- 修改站点根目录下index.php,添加以下代码
/** SaHtmlCach 重定向到HTML静态文件 */
$safile = $_SERVER['REQUEST_URI'];
if(strpos($safile,'comment')<1){
if ($safile=='/'||$safile=='index.php'){
$safile = 'index.html';
}
$sahtmlfile = './usr/plugins/SaHtmlCache/cache/'.$safile;
if(file_exists($sahtmlfile)){
include($sahtmlfile);
exit;
}
}
效果验证
查看网页源代码,如果顶部有
SaCache created 2020/01/01 01:01:01
含有则表示生成成功,没有请查看设置