Permalink
Fetching contributors…
Cannot retrieve contributors at this time
50 lines (41 sloc) 2.98 KB
title ms.custom ms.date ms.prod ms.reviewer ms.suite ms.tgt_pltfrm ms.topic dev_langs helpviewer_keywords ms.assetid caps.latest.revision author ms.author manager
Cache Management for Network Applications
03/30/2017
.net-framework
article
VB
CSharp
C++
jsharp
cache [.NET Framework], network applications
network resources, caching
Internet, caching
fc258a40-f370-434f-ae09-4a8cb11ddaeb
13
mcleblanc
markl
markl

Cache Management for Network Applications

This topic and its related subtopics describe caching for resources obtained using the xref:System.Net.WebClient, xref:System.Net.WebRequest, xref:System.Net.HttpWebRequest, and xref:System.Net.FtpWebRequest classes.

A cache provides temporary storage of resources that have been requested by an application. If an application requests the same resource more than once, the resource can be returned from the cache, avoiding the overhead of re-requesting it from the server. Caching can improve application performance by reducing the time required to get a requested resource. Caching can also decrease network traffic by reducing the number of trips to the server. While caching improves performance, it increases the risk that the resource returned to the application is stale, meaning that it is not identical to the resource that would have been sent by the server if caching were not in use.

Caching may allow unauthorized users or processes to read sensitive data. An authenticated response that is cached may be retrieved from the cache without an additional authorization. If caching is enabled, change to xref:System.Net.WebRequest.CachePolicy%2A to xref:System.Net.Cache.RequestCacheLevel.BypassCache or xref:System.Net.Cache.RequestCacheLevel.NoCacheNoStore to disable caching for this request.

Due to security concerns, caching is not recommended for middle tier scenarios.

In This Section

Cache Policy
Explains what a cache policy is and how to define one.

Location-Based Cache Policies
Defines each type of location-based cache policy available for Hypertext Transfer Protocol (http and https) resources.

Time-Based Cache Policies
Describes the criteria that can be used to customize a time-based cache policy.

Configuring Caching in Network Applications
Describes how to programmatically create cache policies and requests that use caching.

Reference

xref:System.Net.Cache
Defines the types and enumerations used to define cache policies for resources obtained using the xref:System.Net.WebRequest, xref:System.Net.HttpWebRequest, and xref:System.Net.FtpWebRequest classes.