RequestCachePolicy Class

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Defines an application's caching requirements for resources obtained by using WebRequest objects.

Namespace:   System.Net.Cache
Assembly:  System (in System.dll)

System.Object
  System.Net.Cache.RequestCachePolicy
    System.Net.Cache.HttpRequestCachePolicy

Public Class RequestCachePolicy

NameDescription
System_CAPS_pubmethodRequestCachePolicy()

Initializes a new instance of the RequestCachePolicy class.

System_CAPS_pubmethodRequestCachePolicy(RequestCacheLevel)

Initializes a new instance of the RequestCachePolicy class. using the specified cache policy.

NameDescription
System_CAPS_pubpropertyLevel

Gets the RequestCacheLevel value specified when this instance was constructed.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string representation of this instance.(Overrides Object.ToString().)

You can specify a default cache policy for your application by using the DefaultCachePolicy property or the application or machine configuration files. For more information, see <requestCaching> Element (Network Settings).

You can specify the cache policy for an individual request by using the CachePolicy property.

Caching for Web services is not supported.

The following code example creates a policy with Level set to CacheOnly, and uses it to set the cache policy of a WebRequest.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: