Example application with two different kinds of caching on two different endpoints:
-
The HomeController returns a razor page containing preloaded weather data. The weather data itself is cached through the WeatherForecastService.
- The
WeatherForecastServiceuses the CachingService (a wrapper forIDistributedCache) to cache results from the "repository"
- The
-
The ApiController returns JSON formatted weather data. It uses ASP.Net Core Output Caching and does not use the aforementioned
CachingServiceat all.