私信  •  关注

Pramod Shinde

Pramod Shinde 最近创建的主题
Pramod Shinde 最近回复了
7 年前
回复了 Pramod Shinde 创建的主题 » rails redis expire方法

当您指定 expires_in: 21.days 在缓存时,告诉底层缓存存储存储给定密钥的数据(这里 token )在21天内,21天后它将过期,这意味着数据不再可用于您使用的give密钥 exist? 方法检查此。

Rails.cache.exist?(token) # => true  (data is available and you read)
Rails.cache.exist?(token) # => false (cache is expired, data is not available)