-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Description
Laravel Version
12
PHP Version
8.3
Database Driver & Version
No response
Description
Hi. I am using the Cache::flexible method as follows:
$now = Cache::flexible('dateeeeee17', [10, 60], function () { return Carbon::now()->toTimeString(); }); return view('test', compact('now'));
Here is the behavior I am observing:
On the initial request, I get 12:00:00.
For the first 10 seconds (the "fresh" period), the cache correctly returns the same value.
Between 10 and 60 seconds (the "stale" period), I refresh the page several times at 5-second intervals. According to the documentation, the cache should refresh in the background during this period.
However, I still keep seeing the initial value (12:00:00). The new value only appears after 60 seconds, when the cache expires.
It seems that no background refresh is happening during the stale period, contrary to what the documentation suggests.
I have tried searching for existing issues or discussions but couldn’t find anything. Any guidance or confirmation on whether this is expected behavior would be appreciated.
Thank you!
Steps To Reproduce
no steps