redis下如何设置set之类的过期时间

WBOY
Release: 2016-06-06 20:43:17
Original
4554 people have browsed it

比如说用redis做一个浏览计数器,但访问过的同一个人在30分钟内只计数一次,我打算用set集合实现,把访问id放入集合,30分钟后让这个集合自动过期,但貌似没找到相关语法,大家是怎么做的?或其他的思路?

回复内容:

比如说用redis做一个浏览计数器,但访问过的同一个人在30分钟内只计数一次,我打算用set集合实现,把访问id放入集合,30分钟后让这个集合自动过期,但貌似没找到相关语法,大家是怎么做的?或其他的思路?

设置key的过期时间
expire

redis下如何设置set之类的过期时间

http://redis.io 搜 expire
英文看不懂?
http://www.cnblogs.com/ikodota/archive/2012/03/05/php_redis_cn.html
搜 expire

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template