The ABP operates the Redis database through the Stackexchange.redis class library .
Abprediscachemodule : Complete ABP. initialization of the Rediscache module ( Complete General Dependency Injection )
Abprediscacheconfig : Defines the values for Connectionstringkey and databaseidappsetting . These two value objects are the key value of Redis in Web . config . ABP. the Rediscache module obtains the configuration of Redis by reading Web. config.
iabpredisconnectionprovider/abpredisconnectionprovider: read Redis from Web. config ConnectionString information, and generates Connectionmultiplexer objects through ConnectionString . Abpredisconnectionprovider is a singleton implementation, and the connectionmultiplexer object is saved in its local Dictionary . Avoid creating repeatedly.
Abprediscache : inherited from cachebase in the ABP Core library, returned by the Iabpredisconnectionprovider object The Connectionmultiplexer Object operates the redis database.
Abprediscachemanager : Overrides the cachemanagerbase createcacheimplementation method, which is used to create a real Icache object. specifically to Abprediscachemanager is to create Abprediscache.
How do I enable Rediscache ?
By defaultAbpis toAbpmemorycachemanagerInjected into the container (is theAbpkernelmoduleOfInitalizemethod is completed). So we're going to letAbprediscachemanagerPrior toAbpmemorycachemanagerInjected into the container, soCastleInResolveIn the systemIcachemanagerwill be given priority.Abprediscachemanager. The only way to do this is to complete the abprediscachemanager Register in the **module preinitialize of your Web project ( The initalize method of Each module is executed only after the ABP has completed the preinitialize method of all Moudle classes.
Back to ABP source Analysis series Articles Directory
ABP Source Code Analysis 30: Abp.rediscache