Войти
  • 707Просмотров
  • 1 неделя назадОпубликованоMicrosoft Visual Studio

Fast Focus: Caching Options in .NET

Caching can make or break your app’s performance—if you do it right. In this recorded from Live! 360 Fast Focus session, Jason Bock walks through practical caching options in .NET, showing how to move from naive in-memory lists to MemoryCache and the newer HybridCache introduced with .NET 9. You’ll learn how to avoid common pitfalls like memory leaks and cache stampedes while keeping your code clean and maintainable. If you’re a .NET developer looking to speed up data access, reduce database load, or modernize your caching strategy, this session is for you. 🔑 What You’ll Learn • Why caching matters and when it actually helps performance • Trade-offs: speed vs memory usage, and the dangers of cache invalidation • How to use MemoryCache for simple in-process caching • What HybridCache is, and how it unifies in-memory and distributed caching • How to configure expiration policies (absolute vs sliding) and eviction behavior • Handling cache stampede scenarios with HybridCache • How to register caching services in and access them cleanly from your code • When and why to upgrade existing MemoryCache usage to HybridCache ⏱️ Chapters 00:00 Introduction & session goals 01:05 Why caching matters & common trade-offs 03:21 Demo setup: console app & “states” scenario 07:00 MemoryCache & HybridCache basics and configuration 11:00 Expiration, eviction & logging cache behavior 13:40 Cache stampede protection with HybridCache 15:35 Recommendations, upgrade tips & closing thoughts 🔗 Links • Demo repo: • Explore more Live!360 sessions: • Check out upcoming VS Live! events: 👤 Speaker: Jason Bock (@jasonbock), Staff Software Engineer at Rocket Mortgage #dotnet #visualstudio #visualstudio2026