Skip to content

Amit-Limbasiya-27/Redis-Caching-Demo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis-Caching-Demo

We have build one PoC to Cache OData API responses. To store cache data we are using Redis Database.

Packages which are used here:

  • Microsoft.AspNetCore.OData
  • Microsoft.Extensions.Caching.StackExchangeRedis
  • Microsoft.EntityFrameworkCore
  • Microsoft.EntityFrameworkCore.SqlServer

Services used:

  • AddStackExchangeRedisCache (Microsoft.Extensions.Caching.StackExchangeRedis)
  • AddRedisOutputCache (Custom)

Middleware used:

  • UseOutputCache()

Description:

  • Here we add service AddStackExchangeRedisCache which is used to make connection with Redis Database and inject the IDistributedCache dependency for RedisCache implementation.
  • In custom AddRedisOutputCache service, we added AddOutputCache service and remove IOutputCacheStore dependency which is in-memory cache store implementation. Then added IOutputCacheStore dependency with our custom RedisOutputCacheStore implementation.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%