I am trying to learn about caching in .Net Core and have read about in memory-caching which I found pretty easy. But let's say a method returns all Employees but you don't want to return all of them, but lets say 10 at a time. So the API method would have a parameter.
Can I do that with in-memory caching?
These are the articles that I will follow: https://www.c-sharpcorner.com/article/how-to-implement-caching-in-the-net-core-web-api-application/ https://code-maze.com/aspnetcore-in-memory-caching/
You can paginate the list/queryable before actually caching the items so that the items cache the item's for these combination, and after you ask for more items it'll get these items and cache. And the pagination param values will be provided from the API endpoint.
Pagination example:
Cache the values for pagination combination: