Caching in the .NET Stack: Inside-Out

A comprehensive look at caching throughout the .NET stack, covering WCF, Web API, Web Forms and MVC. You'll learn how and where to add caching, and you'll see the huge performance benefits you can expect.
Course info
Rating
(205)
Level
Intermediate
Updated
Jun 27, 2013
Duration
4h 45m
Table of contents
Introduction to Caching in the .NET Stack
Caching Inside the Solution
Solution Cache: Local Stores
Solution Cache: Remote Stores
Controlling Items in the Solution Cache
ASP.NET Output Caching
Caching Outside the Solution
Considerations for Client Caches
Controlling items in Client Caches
Measuring Performance Improvements
Course Summary
Description
Course info
Rating
(205)
Level
Intermediate
Updated
Jun 27, 2013
Duration
4h 45m
Description

In this course we look at caching as a tool to improve your solution's performance and capacity. Using a distributed demo solution, we add caching inside the solution using a simple AOP approach, where you'll learn how to use different caches: the .NET MemoryCache, NCache Express, AppFabric Caching, and memcached. We use some custom caches based on Azure Table Storage and disk shares, and you'll see how to set up ASP.NET Output Caching to use different solution caches. You'll learn how to add caching outside the solution with HTTP response headers so consumers of your website and API can cache solution resources locally, and reduce traffic to your servers. Finally, you'll learn how to analyze items to configure them for maximum cache effectiveness, how to control items in caches, and how to measure the performance improvements you get from caching.

About the author
About the author

Elton is an independent consultant specializing in systems integration with the Microsoft stack. He is a Microsoft MVP, blogger, and practicing Technical Architect.

More from the author
Modernizing .NET Framework Apps with Docker
Intermediate
3h 42m
Dec 28, 2017
More courses by Elton Stoneman
Section Introduction Transcripts
Section Introduction Transcripts

Introduction to Caching in the .NET Stack
Hi, my name's Elton. Welcome to Caching in the. NET Stack: Inside Out. A course which aims to show you how to use caching, to maximize the speed of your solution, and at the same time minimize the hardware you need to run it efficiently. Caching is all about performance, the caching techniques we'll look at can substantially improve the performance of your solution. You'll see a bottom line improvement in the response time of your website or your API, and equally important you'll also see more effective utilization of your infrastructure. If my server's there, caches the result of a database query, and avoids running that query again. Not only does my service layer save the cost of calling the database, but the database saves the cost of executing the query. And if the database is used as efficiently as it can be, then it can support greater load, and as our solution gets more popular, we push about the point where we need to scale the hardware. The same is true of compute resources in your service and presentation layers. So caching throughout the stack will make your solution leaner as well as faster.

Caching Inside the Solution
Hi. My name's Elton. And this is Caching Inside the Solution, the next module in Caching in the. Net Stack Inside Out. In this module, we'll have a tour around the demo solution to see how it looks for consumers, and we'll identify couple of fundamental improvements we can make by adding caching inside the solution. Then we'll implement caching in one part of the solution explicitly by manually using a cache in one of our method calls, and we'll see the basic pattern for caching. Then, we'll take that manual approach and make it generic, using aspect oriented programming, to abstract away the details of the cache pattern, allowing us to add method level caching anywhere in the solution in a simple and consistent way. Next we'll have it deep dive into the code for the CacheCallHandler, which is how our AOP framework does method level caching. And we'll look at an alternative pattern, we can use for scenarios where the normal approach doesn't fit. Lastly, we'll take a step back from the code and look at what we need to know about a resource to decide if it's suitable for caching. And if so what sort of cache, will give us the most effective reuse.