mscorlib(4.0.0.0) API with additions
System.Net.Cache Namespace Reference

Classes

class  HttpRequestCachePolicy
 Defines an application's caching requirements for resources obtained by using T:System.Net.HttpWebRequest objects. More...
 
class  RequestCachePolicy
 Defines an application's caching requirements for resources obtained by using T:System.Net.WebRequest objects. More...
 

Enumerations

enum  CacheFreshnessStatus { Undefined, Fresh, Stale }
 
enum  CacheValidationStatus {
  DoNotUseCache, Fail, DoNotTakeFromCache, RetryResponseFromCache,
  RetryResponseFromServer, ReturnCachedResponse, CombineCachedAndServerResponse, CacheResponse,
  UpdateResponseInformation, RemoveFromCache, DoNotUpdateCache, Continue
}
 
enum  HttpCacheAgeControl {
  HttpCacheAgeControl.None = 0, HttpCacheAgeControl.MinFresh = 1, HttpCacheAgeControl.MaxAge = 2, HttpCacheAgeControl.MaxStale = 4,
  HttpCacheAgeControl.MaxAgeAndMinFresh = 3, HttpCacheAgeControl.MaxAgeAndMaxStale = 6
}
 Specifies the meaning of time values that control caching behavior for resources obtained using T:System.Net.HttpWebRequest objects. More...
 
enum  HttpMethod {
  Other = -1, Head, Get, Post,
  Put, Delete, Options, Trace,
  Connect
}
 
enum  HttpRequestCacheLevel {
  HttpRequestCacheLevel.Default, HttpRequestCacheLevel.BypassCache, HttpRequestCacheLevel.CacheOnly, HttpRequestCacheLevel.CacheIfAvailable,
  HttpRequestCacheLevel.Revalidate, HttpRequestCacheLevel.Reload, HttpRequestCacheLevel.NoCacheNoStore, HttpRequestCacheLevel.CacheOrNextCacheOnly,
  HttpRequestCacheLevel.Refresh
}
 Specifies caching behavior for resources obtained using the Hypertext Transfer protocol (HTTP). More...
 
enum  RequestCacheLevel {
  RequestCacheLevel.Default, RequestCacheLevel.BypassCache, RequestCacheLevel.CacheOnly, RequestCacheLevel.CacheIfAvailable,
  RequestCacheLevel.Revalidate, RequestCacheLevel.Reload, RequestCacheLevel.NoCacheNoStore
}
 Specifies caching behavior for resources obtained using T:System.Net.WebRequest and its derived classes. More...
 

Enumeration Type Documentation

◆ HttpCacheAgeControl

Specifies the meaning of time values that control caching behavior for resources obtained using T:System.Net.HttpWebRequest objects.

Enumerator
None 

For internal use only. The Framework will throw an T:System.ArgumentException if you try to use this member.

MinFresh 

Content can be taken from the cache if the time remaining before expiration is greater than or equal to the time specified with this value.

MaxAge 

Content can be taken from the cache until it is older than the age specified with this value.

MaxStale 

Content can be taken from the cache after it has expired, until the time specified with this value elapses.

MaxAgeAndMinFresh 

P:System.Net.Cache.HttpRequestCachePolicy.MaxAge and P:System.Net.Cache.HttpRequestCachePolicy.MinFresh.

MaxAgeAndMaxStale 

P:System.Net.Cache.HttpRequestCachePolicy.MaxAge and P:System.Net.Cache.HttpRequestCachePolicy.MaxStale.

Definition at line 4 of file HttpCacheAgeControl.cs.

◆ HttpRequestCacheLevel

Specifies caching behavior for resources obtained using the Hypertext Transfer protocol (HTTP).

Enumerator
Default 

Satisfies a request for a resource either by using the cached copy of the resource or by sending a request for the resource to the server. The action taken is determined by the current cache policy and the age of the content in the cache. This is the cache level that should be used by most applications.

BypassCache 

Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. No entries are taken from caches, added to caches, or removed from caches between the client and server. This is the default cache behavior specified in the machine configuration file that ships with the .NET Framework.

CacheOnly 

Satisfies a request using the locally cached resource; does not send a request for an item that is not in the cache. When this cache policy level is specified, a T:System.Net.WebException exception is thrown if the item is not in the client cache.

CacheIfAvailable 

Satisfies a request for a resource from the cache if the resource is available; otherwise, sends a request for a resource to the server. If the requested item is available in any cache between the client and the server, the request might be satisfied by the intermediate cache.

Revalidate 

Compares the copy of the resource in the cache with the copy on the server. If the copy on the server is newer, it is used to satisfy the request and replaces the copy in the cache. If the copy in the cache is the same as the server copy, the cached copy is used. In the HTTP caching protocol, this is achieved using a conditional request.

Reload 

Satisfies a request by using the server. The response might be saved in the cache. In the HTTP caching protocol, this is achieved using the no-cache cache control directive and the no-cache Pragma header.

NoCacheNoStore 

Never satisfies a request by using resources from the cache and does not cache resources. If the resource is present in the local cache, it is removed. This policy level indicates to intermediate caches that they should remove the resource. In the HTTP caching protocol, this is achieved using the no-cache cache control directive.

CacheOrNextCacheOnly 

Satisfies a request for a resource either from the local computer's cache or a remote cache on the local area network. If the request cannot be satisfied, a T:System.Net.WebException exception is thrown. In the HTTP caching protocol, this is achieved using the only-if-cached cache control directive.

Refresh 

Satisfies a request by using the server or a cache other than the local cache. Before the request can be satisfied by an intermediate cache, that cache must revalidate its cached entry with the server. In the HTTP caching protocol, this is achieved using the max-age = 0 cache control directive and the no-cache Pragma header.

Definition at line 4 of file HttpRequestCacheLevel.cs.

◆ RequestCacheLevel

Specifies caching behavior for resources obtained using T:System.Net.WebRequest and its derived classes.

Enumerator
Default 

Satisfies a request for a resource either by using the cached copy of the resource or by sending a request for the resource to the server. The action taken is determined by the current cache policy and the age of the content in the cache. This is the cache level that should be used by most applications.

BypassCache 

Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. This is the default cache behavior specified in the machine configuration file that ships with the .NET Framework.

CacheOnly 

Satisfies a request using the locally cached resource; does not send a request for an item that is not in the cache. When this cache policy level is specified, a T:System.Net.WebException exception is thrown if the item is not in the client cache.

CacheIfAvailable 

Satisfies a request for a resource from the cache, if the resource is available; otherwise, sends a request for a resource to the server. If the requested item is available in any cache between the client and the server, the request might be satisfied by the intermediate cache.

Revalidate 

Satisfies a request by using the cached copy of the resource if the timestamp is the same as the timestamp of the resource on the server; otherwise, the resource is downloaded from the server, presented to the caller, and stored in the cache.

Reload 

Satisfies a request by using the server. The response might be saved in the cache. In the HTTP caching protocol, this is achieved using the no-cache cache control directive and the no-cache Pragma header.

NoCacheNoStore 

Never satisfies a request by using resources from the cache and does not cache resources. If the resource is present in the local cache, it is removed. This policy level indicates to intermediate caches that they should remove the resource. In the HTTP caching protocol, this is achieved using the no-cache cache control directive.

Definition at line 4 of file RequestCacheLevel.cs.