Closed Znote closed 3 years ago
Sure, you are right.
Here some base class, you can start with: https://github.com/slawkens/myaac/blob/master/system/libs/cache_apcu.php
Looks like the cache class can be directly rewritten to support APCu without breaking the usage pattern of our existing cache system, here is a prototype:
https://gist.github.com/Znote/d48bbc11adbe3d3e7a524e4286b5a05f
APCu caching is waaay faster than our current caching system.
Instead of storing and loading cache into flatfiles (which can be messy if we consider file permissions and stuff in unix), we can store the cache data directly in memory.(/RAM).
We can also store this natively as PHP arrays, so no need to encode/decode data to and from json.
While APC is obsolete, APCu version 5+ supports PHP 7.