From bd70da761516fb0004fc781f2d336b06176a77df Mon Sep 17 00:00:00 2001 From: filesite Date: Tue, 18 Mar 2025 07:21:27 +0800 Subject: [PATCH] change readme cache time to 365 days --- themes/beauty/controller/ListController.php | 3 ++- themes/beauty/controller/SiteController.php | 11 +++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/themes/beauty/controller/ListController.php b/themes/beauty/controller/ListController.php index 80f6a1f..259052d 100644 --- a/themes/beauty/controller/ListController.php +++ b/themes/beauty/controller/ListController.php @@ -137,7 +137,7 @@ Class ListController extends Controller { //获取根目录下的readme $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $expireSeconds = 86400; + $expireSeconds = 86400 * 365; $readmeFile = Common::getCacheFromFile($cacheKey, $expireSeconds); if (!empty($readmeFile)) { $htmlReadme = $readmeFile['htmlReadme']; @@ -465,6 +465,7 @@ Class ListController extends Controller { //获取根目录下的readme $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); + $expireSeconds = 86400 * 365; $readmeFile = Common::getCacheFromFile($cacheKey, $expireSeconds); if (!empty($readmeFile)) { $htmlReadme = $readmeFile['htmlReadme']; diff --git a/themes/beauty/controller/SiteController.php b/themes/beauty/controller/SiteController.php index 0a01e75..79df29d 100644 --- a/themes/beauty/controller/SiteController.php +++ b/themes/beauty/controller/SiteController.php @@ -90,7 +90,8 @@ Class SiteController extends Controller { //获取联系方式 $titles = array(); $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $cachedData = Common::getCacheFromFile($cacheKey); + $cacheSeconds = 86400 * 365; + $cachedData = Common::getCacheFromFile($cacheKey, $cacheSeconds); if (empty($cachedData)) { $readmeFile = $scanner->getDefaultReadme(); if (!empty($readmeFile)) { @@ -790,7 +791,8 @@ Class SiteController extends Controller { //获取联系方式 $maxScanDeep = 0; //最大扫描目录级数 $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $readmeFile = Common::getCacheFromFile($cacheKey); + $cacheSeconds = 86400 * 365; + $readmeFile = Common::getCacheFromFile($cacheKey, $cacheSeconds); //底部版权申明配置支持 $copyright = ''; @@ -858,7 +860,8 @@ Class SiteController extends Controller { //获取联系方式 $maxScanDeep = 0; //最大扫描目录级数 $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $readmeFile = Common::getCacheFromFile($cacheKey); + $cacheSeconds = 86400 * 365; + $readmeFile = Common::getCacheFromFile($cacheKey, $cacheSeconds); //底部版权申明配置支持 $copyright = ''; @@ -1020,7 +1023,7 @@ Class SiteController extends Controller { //获取根目录下的readme $htmlReadme = ''; $cacheKey = $this->getCacheKey('root', 'readme', $maxScanDeep); - $expireSeconds = 86400; + $expireSeconds = 86400 * 365; $readmeFile = Common::getCacheFromFile($cacheKey, $expireSeconds); if (!empty($readmeFile)) { $htmlReadme = $readmeFile['htmlReadme'];