To enable redis to monitor key expiration, you need to add configuration.
Recommended: redis introductory tutorial
Implementation principle: In versions after Redis2.8, when we cache the
Because turning on the key space notification function requires some CPU, this function is turned off in the default configuration.
My configuration is like this:
notify-keyspace-events Ex
Related recommendations:
mysql video tutorial:https: //www.php.cn/course/list/51.html
The above is the detailed content of How redis monitors key expiration. For more information, please follow other related articles on the PHP Chinese website!