Expired keys still exist in redis

I would like to inform a bug in redis cache implementation. The keys are not removed after its expiry.


In the screenshot, the keys test_ and online_1001 continues to exist in PHCR set even after expiry. Please note these keys are not present on the list on left panel.

Its problematic since


would show even dead keys

Though when I try


it returns correctly (i.e.,false)

This 'feature' is not specific only to Redis. All backend adapters implemented in Phalcon work like that. queryKeys() method will always return all keys ever stored. That's due to the existence of 'statsKey' bag being set not to expire by default. If you ommit key during cache initialization, queryKeys() method will not work. But you resolve this issue. Define it like this for backend cache adapters:

            'lifetime' => 0x0000000a,
            'prefix'   => 'cartData_', //actual prefix of the keys
            'statsKey' => null