Implementing caching in an API is recommended for several reasons, including improving performance and reducing operational costs.
This project's commit history explores and compares different ways of adding caching to your .NET API. It was also the basis for a Medium article.
In this article, you will find:
- injecting a cache provider in the file where you want to insert cache;
- cache injection using the decorator pattern;
- automatically injecting cache into all your services/repositories;