filmov
tv
Using IMemoryCache to cache data in-memory using .NET 5 [An Introduction]
Показать описание
In this video, I am going to walk through how to cache data in-memory using the IMemoryCache interface in .NET 5.
Caching is a very useful mechanism to easily increase the performance of any application.
Previously I have covered topics on distributed cache services.
00:05 - Introduction of what is caching
02:45 - Explain the problem domain
03:34 - Create a new class for implementing cache using IMemoryCache
04:55 - Get an item from the cache using a key
05:50 - Add item to the cache
06:50 - Different overloads for adding cache
07:15 - Elaborate MemoryCacheEntryOptions object
07:35 - Explaining cache expiration and difference between sliding and absolute expiration policy
09:20 - Explanation of how to avoid stale data forever when using sliding expiration
10:15 - What is a post-eviction callback and how it can be useful
11:00 - Cache priority
11:15 - Size of the cache entry
11:50 - Mechanism I follow to add items to the cache using TryGetValue method
13:40 - Configuring dependency injection for IMemoryCache
14:05 - Explaining the overloads for AddMemoryCache extension method for adding IMemoryCache to the dependency injection
15:00 - explaining CompactionPercentage property
16:05 - Update the API to use the cache provider to get data
17:05 - Debug through the code and explain how the feature is working
Caching is a very useful mechanism to easily increase the performance of any application.
Previously I have covered topics on distributed cache services.
00:05 - Introduction of what is caching
02:45 - Explain the problem domain
03:34 - Create a new class for implementing cache using IMemoryCache
04:55 - Get an item from the cache using a key
05:50 - Add item to the cache
06:50 - Different overloads for adding cache
07:15 - Elaborate MemoryCacheEntryOptions object
07:35 - Explaining cache expiration and difference between sliding and absolute expiration policy
09:20 - Explanation of how to avoid stale data forever when using sliding expiration
10:15 - What is a post-eviction callback and how it can be useful
11:00 - Cache priority
11:15 - Size of the cache entry
11:50 - Mechanism I follow to add items to the cache using TryGetValue method
13:40 - Configuring dependency injection for IMemoryCache
14:05 - Explaining the overloads for AddMemoryCache extension method for adding IMemoryCache to the dependency injection
15:00 - explaining CompactionPercentage property
16:05 - Update the API to use the cache provider to get data
17:05 - Debug through the code and explain how the feature is working
Комментарии