iammukeshm / CleanArchitecture.WebApi

An implementation of Clean Architecture for ASP.NET Core 3.1 WebAPI. Built with loosely coupled architecture and clean-code practices in mind.
MIT License
1.4k stars 343 forks source link

How to add redis caching support? #8

Closed lemchen closed 4 years ago

lemchen commented 4 years ago

How to add redis caching support? It is just simplely add some redis code to Controller in webapi?

iammukeshm commented 4 years ago

You do not want to add any redis code to the controller. It's advisable to move the redis cache calls to the application layer within the MediatR implementations. It would be a cleaner fit.

Also, here is a post on Redis Caching - https://www.codewithmukesh.com/blog/redis-caching-in-aspnet-core/

lemchen commented 4 years ago

Thanks for your suggestion