From 2e7c5a4bb856d7b474b0303d65769e099d888820 Mon Sep 17 00:00:00 2001 From: IanM Date: Thu, 19 Mar 2026 09:42:49 +0000 Subject: [PATCH] chore: upgrade illuminate/redis to Laravel 13; use Cache::flexible for settings - Bump illuminate/redis from ^11.0||^12.0 to ^13.0 - Replace Cache::remember with Cache::flexible in RedisCacheSettingsRepository to serve stale settings for the last 5 minutes of the TTL while one background process refreshes, eliminating the expiry stampede --- composer.json | 2 +- src/Settings/RedisCacheSettingsRepository.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b63bed7..1bce2d8 100644 --- a/composer.json +++ b/composer.json @@ -30,7 +30,7 @@ }, "require": { "flarum/core": "^2.0.0", - "illuminate/redis": "^11.0 || ^12.0", + "illuminate/redis": "^13.0", "predis/predis": "^v2.3.0" }, "autoload": { diff --git a/src/Settings/RedisCacheSettingsRepository.php b/src/Settings/RedisCacheSettingsRepository.php index b770023..bc1614c 100644 --- a/src/Settings/RedisCacheSettingsRepository.php +++ b/src/Settings/RedisCacheSettingsRepository.php @@ -44,7 +44,7 @@ public function all(): array $this->loading = true; try { - return $this->cache->remember($this->cacheKey, $this->ttl, function () { + return $this->cache->flexible($this->cacheKey, [$this->ttl - 300, $this->ttl], function () { return $this->inner->all(); }); } finally {