Laravel Octane Cache not persistent

Viewed 518
  • Octane Version: 1.0.8
  • Laravel Version: 8.50.0
  • PHP Version: 8.0
  • Server & Version: Swoole 4.6.7
  • Database Driver & Version: MySQL 8.0.25

Everything works as expected when using Redis for example.

cache()->store('redis')->remember("test_key", now()->addMinutes(), fn() => 'test_value');

Cache::remember() method does not store the value when using Laravel Octane Cache. (returns null)

cache()->store('octane')->remember("test_key", now()->addMinutes(), fn() => 'test_value');

I did another tests and seems that Octane store is not persistent. If I use put then get immediately will receive the value, if I use put then refresh the page the value will be null. This is only for Octane driver. Redis store works fine.

cache()->store('octane')->put("test_key", 'test_value', now()->addMinutes());

cache()->store('octane')->get("test_key"); => returns null

Redis works as expected.

cache()->store('redis')->put("test_key", 'test_value', now()->addMinutes());

cache()->store('redis')->get("test_key"); => returns test_value

0 Answers
Related