An open API service indexing awesome lists of open source software.

https://github.com/sandeepkv93/webappwithrediscache

Simple Example of how Redis cache and InMemory Cache can be used in a ASP.NET Core Web API Project
https://github.com/sandeepkv93/webappwithrediscache

asp-net-core inmemory-cache redis-cache stackexchange-redis

Last synced: about 1 year ago
JSON representation

Simple Example of how Redis cache and InMemory Cache can be used in a ASP.NET Core Web API Project

Awesome Lists containing this project

README

          

### Overview
- This is an example Web App to demonstrate the use of Dotnet Core InMemoryCaching and using a distributed caching system "Redis".
- In this example, we run the redis cluster locally using Docker.
- For fetching the current weather, this App uses the OpenWeather APIs: https://openweathermap.org/
- We are creating a new Attribute class which also implements an `IAsyncActionFilter` interface to intercepts the requests and serve it from cache if it is present in cache. Else, this also caches the response which is used in subsequent API calls.

### Running Redis Cluster via docker locally
docker run -p 6379:6379 --name redis-master -e REDIS_REPLICATION_MODE=master -e ALLOW_EMPTY_PASSWORD=yes bitnami/redis:latest