From 7f377fe2f740322951f318d62e18b40898f8b371 Mon Sep 17 00:00:00 2001 From: Snowz <372492339@qq.com> Date: Tue, 5 Aug 2025 16:05:44 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20=E5=BB=B6=E9=95=BF=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=87=B37=E5=A4=A9=E4=BB=A5=E6=8F=90?= =?UTF-8?q?=E5=8D=87=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化缓存策略,将缓存时间从10分钟延长至7天,减少API调用频率 --- info.php | 2 +- readme.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/info.php b/info.php index 0612ef1..0255c57 100644 --- a/info.php +++ b/info.php @@ -7,7 +7,7 @@ $apiBaseUrl = 'https://um.com'; $token = '你的tocken'; $websiteId = '你的网站id'; $cacheFile = 'umami_cache.json'; -$cacheTime = 600; // 缓存时间为10分钟(600秒) +$cacheTime = 604800; // 缓存时间为7天(604800秒) // 获取当前时间戳(毫秒级) $currentTimestamp = time() * 1000; diff --git a/readme.md b/readme.md index 0e1f1ac..eab7958 100644 --- a/readme.md +++ b/readme.md @@ -139,12 +139,42 @@ const BOOKED_STATUS = { 4. 保持价格系数的合理性 ## 更新日志 +### 2025-08-05 +- 优化缓存策略:将info.php中的缓存时间从10分钟(600秒)延长至7天(604800秒) +- 提升系统性能,减少API调用频率 + ### 2024-02-29 - 初始版本发布 - 实现动态定价系统 - 添加广告位预览功能 - 优化移动端显示效果 +## 维护说明 +umami的升级后会导致token丢失,需要定期的去获取新的token,否则会导致无法获取到实时的访问量数据。 +token获取:POST /api/auth/login +``` +{ + "username": "your-username", + "password": "your-password" +} +``` +如果成功,你应该得到以下类似的响应: +``` +{ + "token": "eyTMjU2IiwiY...4Q0JDLUhWxnIjoiUE_A", + "user": { + "id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", + "username": "admin", + "role": "admin", + "createdAt": "2000-00-00T00:00:00.000Z", + "isAdmin": true + } +} +``` +- 定期更新访问量数据接口 +- 监控系统运行状态 +- 及时处理异常情况 + ## 未来计划 - 可在线支付的自助广告系统,绑定对应广告位的动态码,实现全程自助下单并完成广告投放。