Windows .NET Framework - Caching API Reference

Caching API Overview

The Caching API provides classes and methods for creating and managing caching mechanisms within your .NET applications. Caching can significantly improve application performance by reducing the number of trips to the server. This API supports various caching strategies, including memory caching and disk caching.

Table of Contents

Memory Cache

The Memory Cache class enables you to create caching mechanisms that store data in the application's memory. This is ideal for frequently accessed data that does not change often.

MemoryCache

Provides a general-purpose caching API. Allows you to store objects in memory, retrieve them quickly, and optionally expire them based on time or other criteria.

Disk Cache

The DiskCache class allows you to store data on the file system. This can be useful for caching large datasets or data that changes less frequently than memory cache data. Note: this was largely superseded by the MemoryCache class.

DiskCache

Provides a caching mechanism that stores data on the file system. While useful, MemoryCache is now generally preferred.

Cache Configuration

Configuration options allow you to tailor the behavior of the cache to your application's needs. These include setting cache expiration times, concurrency levels, and memory usage limits.