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
- Host: GitHub
- URL: https://github.com/sandeepkv93/webappwithrediscache
- Owner: sandeepkv93
- Created: 2022-08-28T01:15:54.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-08-28T19:21:19.000Z (over 3 years ago)
- Last Synced: 2025-01-24T11:44:48.809Z (over 1 year ago)
- Topics: asp-net-core, inmemory-cache, redis-cache, stackexchange-redis
- Language: C#
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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