TubeSum

Simple Caching with FusionCache — Step-by-Step Guide & Transcript

Simple Caching with FusionCache in .NET

Published Nov 15, 2025 Transcribed Aug 8, 2026 M Milan Jovanović
Beginner 1 min read For: Developers new to caching in .NET who want a quick example of using FusionCache.
AI Trust Score 70/100
⚠️ Average / Some Fluff

"The title promises a simple example and delivers exactly that, though it's brief and lacks depth."

AI Summary

This video demonstrates a simple implementation of caching using the Fusion Cache library in a .NET application. It shows how to use the iFusionCache interface to implement the cache-aside pattern, improving performance by storing frequently accessed data.

[00:00]
Introduction to FusionCache caching

The video starts by explaining a simple example of implementing caching using the FusionCache library, focusing on generating a cache key and a variable for a cacheable DTO.

[00:15]
Using iFusionCache.GetOrSetAsync

The iFusionCache interface exposes a GetOrSetAsync method that allows easy implementation of the cache-aside pattern. The method takes a cache key and a delegate acting as a factory to fetch the value if not present in the cache, such as a typical EF Core query.

[00:27]
Configuring caching options

Caching options can be configured, including cache duration and an optional failsafe. If a null value is returned, the code returns Not Found; otherwise, it returns the value from the controller endpoint.

[00:41]
Performance improvement

If the value wasn't present in the cache on the first request, it will be there for subsequent requests, improving performance.

The video provides a straightforward demonstration of using FusionCache to implement caching in a .NET application, highlighting the simplicity and performance benefits of the cache-aside pattern.

Mentioned in this Video

Tutorial Checklist

1 00:00 Generate a cache key and a variable for the cacheable DTO.
2 00:15 Use iFusionCache.GetOrSetAsync with the cache key and a factory delegate to fetch the value if not cached.
3 00:27 Configure caching options such as duration and optional failsafe.
4 00:27 Return not found if null, otherwise return the value from the controller endpoint.

Study Flashcards (4)

What method does iFusionCache expose for implementing the cache-aside pattern?

easy Click to reveal answer

GetOrSetAsync

00:15

What is the purpose of the delegate in GetOrSetAsync?

medium Click to reveal answer

It acts as a factory to fetch the value if it's not present in the cache.

00:15

What happens if a null value is returned from the cache?

easy Click to reveal answer

The code returns not found.

00:27

What are two caching options that can be configured?

medium Click to reveal answer

Cache duration and an optional failsafe.

00:27

💡 Key Takeaways

🔧

Cache-aside pattern with GetOrSetAsync

Shows a clean, idiomatic way to implement caching in .NET, reducing boilerplate code.

00:15
📊

Performance improvement

Highlights the direct benefit of caching: faster subsequent requests.

00:41

[00:00] Here's a simple example of how you can implement caching using the Fusion Cache library. I'll start by generating a cache key and a variable to hold my cacheable DTO. The iFusionCache interface exposes a get or set async method,

[00:15] which allows us to easily implement the cache aside pattern. I'll specify the cache key and a delegate that's going to act as a factory to fetch the value if it's not present in the cache. This could be your typical EF core query.

[00:27] you can also configure the caching options such as the cache duration and an optional failsafe if you do end up getting an all value then we can just return not found otherwise we're going to return this value from the controller endpoint and if it wasn't present in the cache on the first

[00:41] request it's going to be there for any subsequent requests which is going to improve our performance

More from Milan Jovanović

View all

⚡ Saved you time reading this? Transcribe any YouTube video for free — no signup needed.