Skip to content

Amit-Limbasiya-27/odata-redis-caching-without-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

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