
Caching is a mechanism for:-
• Storing data close to where it is used than the original source.
• A mechanism used to speed up the system.
• A mechanism for decreasing load on a system component.
Caching is most effective when a client instance repeatedly reads the same data, especially if all the following conditions apply to the original data store:
• It remains relatively static.
• It's slow compared to the cache’s speed.
• It's subject to a significant level of contention.
It's far away when network latency can cause access to be slow.
• Redis is an advanced key-value store, where keys can contain data structures such as strings, hashes, lists, sets and sorted sets. Redis supports a set of atomic operations on these data types.
• Azure Redis Cache is based on the popular open-source Redis cache. It gives you access to a secure, dedicated Redis cache, managed by Microsoft and accessible from any application within Azure.
• Azure Redis Cache uses Redis authentication and also supports SSL connections to Redis.
• Azure Redis Cache is easy to use. Just provision a cache using the Microsoft Azure portal and call into its end point using any client that supports Redis.
• Azure Redis Cache is easy to manage. You can also easily monitor the health and performance of your cache through the Azure portal.
• Also, you can have Microsoft manage replication of the cache for you, helping increase the availability of your cache data across cache failures.
.NET applications can use the StackExchange.Redis cache client, which can be configured in Visual Studio using a NuGet package that simplifies the configuration of cache client applications.
Sample Client:
1. Get the Redis Connection String: Azure Portal à Redis Caches à Select the Cache Created à Settings à Access Keys à Copy to Notepad Primary Connection String to be used in code later.
2. Open Visual Studio 2017, and create a new console application called RedisCacheClient.
3. Add the StackExchange.Redis NuGet package to the application.
4. Add the Newtonsoft.Json.net NuGet package to the application.
5. Add the following to the Console Application.
Private caching
The most basic type of cache is an in-memory store. It's held in the address space of a single process and accessed directly by the code that runs in that process. This type of cache is very quick to access. It can also provide an extremely effective means for storing modest amounts of static data, since the size of a cache is typically constrained by the volume of memory that's available on the machine hosting the process.
If you need to cache more information than is physically possible in memory, you can write cached data to the local file system. This will be slower to access than data that's held in-memory but should still be faster and more dependable than retrieving data across a network. If you have multiple instances of an application that uses this model running concurrently, each application instance has its own independent cache holding its own copy of the data.
Think of a cache as a snapshot of the original data at a point in the past. If this data is not static, it is likely that different application instances hold different versions of the data in their caches. Therefore, the same query performed by these instances can return different results.
This course provides a clear and practical introduction to Azure Redis Cache, focusing on how caching improves application performance, scalability, and responsiveness in real-world systems.
You will begin with a strong foundation by understanding what caching is and why it is a critical component in modern application architectures. The course explains common caching problems and how in-memory caching helps reduce database load and improve response times.
As the course progresses, you will be introduced to Azure Redis Cache, learning what Redis is, how Azure Redis Cache works, and where it fits within the Azure ecosystem. You will understand key Redis concepts and how distributed caching differs from in-process caching.
The course then moves into programming with Redis Cache, helping you understand how applications interact with Redis to store and retrieve cached data. You will explore different caching strategies, learning when and how data should be cached to achieve the best performance results.
A dedicated section focuses on using Azure Redis Cache with ASP.NET, including the ASP.NET Output Cache Provider for Azure Redis Cache. This gives you practical insight into how Redis is used in real-world web applications to cache responses efficiently.
Each topic is explained through focused, easy-to-follow video lessons. Practice tests are included to help you validate your understanding and reinforce key caching concepts.
By the end of this course, you will have a solid understanding of Azure Redis Cache and be confident in applying caching strategies to improve application performance.