Temporary workaround for Servicestack.redis cache expiration, not invalidated

Source: Internet
Author: User
Tags redis version

Server: Redis version of the operating environment, the production environment is full memory run.

Client NuGet Introduction: Servicestack.redis

Add the Cache code:

        <summary>//Set///</summary>//        <typeparam name= "T" > Type </typeparam >//        <param name= "key" > Key </param>//        <param name= "T" > Value </param>//        < param name= "Timeout" > How many minutes after expiration </param>//        <returns></returns> public        static bool Set <T> (string key, T T, double minout = 60*3)        {            using (var redisclient = redismanager.getclient ())            {
   key = "str_" + key;                Return redisclient.set<t> (Key, T, Expiredatetime (minout));            }        }

However, after a corresponding time, the cache is not invalidated. Made a variety of attempts .... At last:

Get all cache names

List<string> Getallkeys ();

Clear the point, or you can kill it all.

        void Flushall ();        T get<t> (string key);        Idictionary<string, t> getall<t> (ienumerable<string> keys);        Long Increment (string key, uint amount);        BOOL Remove (string key);        void RemoveAll (ienumerable<string> keys);

Hope to give some methods. Solving problems is not all about technology, but also the way.

Temporary workaround for Servicestack.redis cache expiration, not invalidated

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.