APCu being unreliable, how to fix it?

APCu is not working properly and I’m hoping to get help to understand what the problem might be, and hopefully how to fix it.

apcu_store(‘x’) stores an entry and a value just fine. But when the entry is deleted and created again with a new value it starts switching back and forth between the old and the new value. I’ve tried both apcu_add(‘x’) and apcu_store(‘x’) but they are equally unreliable.

Also there is issue with that apcu_exists(‘x’) doesn’t find the entry at all, sometimes! When I run apcu_cache_info() there is an entry stored, but apcu_exists() doesn’t always find it. Sometimes it does, but sometimes it doesn’t…

Eventually the data is lost completely from the cache even though the ttl of the entry is set to several hours (21600).

Can anyone please tell me what the issue might be and if I can fix it?

I want to store a few lines of ID’s in an array from the database, not much data to be talking about at all!

Windows 11
x64-system
PHP 8.1.23
APCu version 5.1.23 (NTS for x64, PHP 8.1) (also tried 5.1.24)
LocalWP running a WordPress site.

SUMMARY:
I tried apcu_fetch(‘x’) and expect correct value in return.
After apcu_delete(‘x’) and apcu_store(‘x’) with new value I get sometimes the new value and sometimes the old value with apcu_fetch(‘x’).

I tried to check for the entry with apcu_exists(‘x’) but this also give unreliable returns. Sometimes it finds the entry, sometimes it doesn’t.

I use apcu_cache_info() to see that there is a stored value, but eventually the cache is cleared even though not close to have ttl run out.