OSF. Datacache Open Source Cache middleware use

Source: Internet
Author: User
Tags redis desktop manager

Redis is installed

OSF Open Source Cache middleware

Description: IIS, Redis cache (available for distributed systems) was implemented in the 1.0 version class library
1. IIS
2. Redis

One, add files to the project

A, quote ServiceStack 3.9.60 Unlimited plate

Related files http://pan.baidu.com/s/1kVJFEMr Password: 2XVT

B, reference OSF. DataCache.dll

First: Tools-nuget Package Manager-Package Manager console input:install-package OSF. Datacache

First: Tool-nuget Package Manager-NuGet Package search input for Management solution:OSF. Datacache

Second, the Code implementation

//get cached data can be saved to a profile, or configuration center according to your own project parameters            #regionThis piece can be placed in a global file.Redisconfigmodel Redismodel=NewRedisconfigmodel (); Redismodel.readwritehosts="127.0.0.1:6379"; Redismodel.readonlyhosts="127.0.0.1:6379"; Redismodel.maxwritepoolsize= -; Redismodel.maxreadpoolsize= -; Redismodel.localcachetime= the; Redismodel.autostart=true; Redismodel.recordelog=true; Redismodel.defaultdb=4; OSF.            DataCache.RedisCacheHelper.Init (Redismodel); #endregion            //Get Cache            stringCacheKey =string. Format ("OSF. Datacache.cachetest"); stringobj = OSF. datacache.rediscachehelper.getcache<string>(CacheKey); if(obj = =NULL) {OSF. DataCache.RedisCacheHelper.SetCache (CacheKey,"----------test Data--------"); }
View Code

Third, view the data

Visual Tools-redis Desktop Manager

Note: In the spirit of learning, exercise purposes, there are inappropriate, or have a good idea please enlighten us. Interested friends come together:(315499472)

OSF. Datacache Open Source Cache middleware use

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.