There are a few things that can stop the cache from working.
- Is Zend OPcache enabled in your PHP 7.1 installation?
- Is your opcache memory limit high enough to store all the objects you are trying to cache?
- Are you actually trying to cache objects/arrays, or are you using primitives? Strings/numbers should still be fast using this method, but they might be a tad slower than APCu because there is no serialization taking place.