Redis one or two things-set expiration time, show key as folder display cache data

Source: Internet
Author: User

When using Redis, there are times when there is a lot of data back, and the same classification, the same ID

Can be set using Hset, so there is a large class and a small classification and a value composition

However, Hset cannot set the expiration time

Expiration time can only be set on set

             1  Adding cache to REDIS 2             jedisclient.set (Redis_item_key + ":" + itemId + ":" + Item_ KEY, Jsonutils.objecttojson (item)); 3              Set the expiration time for KEY 4             jedisclient.expire (Redis_item_key + ":" + itemId + ":" + Item_key, Item_expire_time);

So this setting is displayed as a folder when viewed, so it's easy to see

Redis one or two things-set expiration time, show key as folder display cache data

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.