Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions xml/System.Net.Cache/HttpCacheAgeControl.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

## Examples
The following code example creates a policy based on MaxAgeAndMinFresh.

:::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet9":::

]]></format>
Expand Down Expand Up @@ -300,7 +300,7 @@
</ReturnValue>
<MemberValue>0</MemberValue>
<Docs>
<summary>For internal use only. The Framework will throw an <see cref="T:System.ArgumentException" /> if you try to use this member.</summary>
<summary>For internal use only. An <see cref="T:System.ArgumentException" /> is thrown if you try to use this member.</summary>
</Docs>
</Member>
</Members>
Expand Down
12 changes: 1 addition & 11 deletions xml/System.Net.Cache/HttpRequestCacheLevel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,25 +49,15 @@
## Remarks
This enumeration is used to set the cache level specified by <xref:System.Net.Cache.HttpRequestCachePolicy> objects.

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

The <xref:System.Net.HttpWebRequest.DefaultCachePolicy?displayProperty=nameWithType> property is used to get or set the default cache policy for <xref:System.Net.HttpWebRequest> instances. The <xref:System.Net.WebRequest.DefaultCachePolicy?displayProperty=nameWithType> property is used to get or set the default cache policy for a <xref:System.Net.WebRequest> instance. The <xref:System.Net.WebRequest.CachePolicy> property is used to get or set the cache policy for a specific request.

A copy of a resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. So another request for the same resource could use a cached copy, depending on the default cache policy level for this request.



## Examples
The following code example sets the application domain's caching policy to Default.

:::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet2":::

]]></format>
</remarks>
<altmember cref="P:System.Net.HttpWebRequest.DefaultCachePolicy" />
<altmember cref="P:System.Net.WebRequest.CachePolicy" />
<related type="Article" href="/dotnet/framework/network-programming/cache-management-for-network-applications">Cache Management for Network Applications</related>
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings">RequestCaching Element (Network Settings)</related>
</Docs>
<Members>
<Member MemberName="BypassCache">
Expand Down Expand Up @@ -107,7 +97,7 @@
</ReturnValue>
<MemberValue>1</MemberValue>
<Docs>
<summary>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.</summary>
<summary>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.</summary>
</Docs>
Comment thread
gewarren marked this conversation as resolved.
</Member>
<Member MemberName="CacheIfAvailable">
Expand Down
18 changes: 2 additions & 16 deletions xml/System.Net.Cache/HttpRequestCachePolicy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,12 @@
<format type="text/markdown"><![CDATA[

## Remarks
You can specify a default cache policy for your application by using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property or the application or machine configuration files. For more information, see [&lt;requestCaching&gt; Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings).
You can specify a default cache policy for your application by using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property.

You can specify the cache policy for an individual request by using the <xref:System.Net.WebRequest.CachePolicy> property.

Caching for Web services is not supported.



## Examples
The following code example creates a default cache policy for the application domain, and overrides it for a request.

:::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet2":::

]]></format>
</remarks>
<related type="Article" href="/dotnet/framework/network-programming/cache-management-for-network-applications">Cache Management for Network Applications</related>
Expand Down Expand Up @@ -527,14 +520,7 @@
<format type="text/markdown"><![CDATA[

## Remarks
Applications typically use <xref:System.Net.Cache.HttpRequestCacheLevel.Default> as their cache policy level. The <xref:System.Net.WebRequest.CachePolicy> property, if not `null`, determines the cache policy in effect for a request. The default policy for the application domain can be set using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property or by settings in the machine or application configuration files. For more information, see [&lt;requestCaching&gt; Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings).



## Examples
The following code example demonstrates displaying the value of this property.

:::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet11":::
Applications typically use <xref:System.Net.Cache.HttpRequestCacheLevel.Default> as their cache policy level. The <xref:System.Net.WebRequest.CachePolicy> property, if not `null`, determines the cache policy in effect for a request. The default policy can be set using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property.

]]></format>
</remarks>
Expand Down
5 changes: 1 addition & 4 deletions xml/System.Net.Cache/RequestCacheLevel.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
## Remarks
Members of this enumeration are used to initialize <xref:System.Net.Cache.RequestCachePolicy> objects. The current setting for a <xref:System.Net.Cache.RequestCachePolicy> object is available in the <xref:System.Net.Cache.HttpRequestCachePolicy.Level?displayProperty=nameWithType> property.

This <xref:System.Net.Cache.HttpRequestCacheLevel.BypassCache> value is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. No entries are taken from caches, added to caches, or removed from caches between the client and server.

The <xref:System.Net.HttpWebRequest.DefaultCachePolicy?displayProperty=nameWithType> property is used to get or set the default cache policy for <xref:System.Net.HttpWebRequest> instances. The <xref:System.Net.WebRequest.CachePolicy?displayProperty=nameWithType> property is used to get or set the default cache policy for a <xref:System.Net.WebRequest> instances. The <xref:System.Net.WebRequest.CachePolicy?displayProperty=nameWithType> property is used to get or set the cache policy for a specific request.

If the cache behavior is `CacheIfAvailable` or `Revalidate`, a copy of a requested resource is only added to the cache if the response stream for the resource is retrieved and read to the end of the stream. With `CacheIfAvailable`, subsequent requests for the same resource would use a cached copy. With `Revalidate`, subsequent requests for the same resource would use a cached copy if the timestamp for the cached resource is the same as the timestamp of the resource on the server.
Expand All @@ -67,7 +65,6 @@ A copy of a resource is only added to the cache if the response stream for the r
<altmember cref="P:System.Net.HttpWebRequest.DefaultCachePolicy" />
<altmember cref="P:System.Net.WebRequest.CachePolicy" />
<related type="Article" href="/dotnet/framework/network-programming/cache-management-for-network-applications">Cache Management for Network Applications</related>
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings">RequestCaching Element (Network Settings)</related>
</Docs>
<Members>
<Member MemberName="BypassCache">
Expand Down Expand Up @@ -107,7 +104,7 @@ A copy of a resource is only added to the cache if the response stream for the r
</ReturnValue>
<MemberValue>1</MemberValue>
<Docs>
<summary>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.</summary>
<summary>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.</summary>
</Docs>
</Member>
<Member MemberName="CacheIfAvailable">
Expand Down
13 changes: 2 additions & 11 deletions xml/System.Net.Cache/RequestCachePolicy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,12 @@
<format type="text/markdown"><![CDATA[

## Remarks
You can specify a default cache policy for your application by using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property or the application or machine configuration files. For more information, see [&lt;requestCaching&gt; Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings).
You can specify a default cache policy for your application by using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property.

You can specify the cache policy for an individual request by using the <xref:System.Net.WebRequest.CachePolicy> property.

Caching for Web services is not supported.



## Examples
The following code example creates a policy with <xref:System.Net.Cache.RequestCachePolicy.Level*> set to <xref:System.Net.Cache.RequestCacheLevel.CacheOnly>, and uses it to set the cache policy of a <xref:System.Net.WebRequest>.

Expand Down Expand Up @@ -231,14 +229,7 @@
## Remarks
Applications typically use <xref:System.Net.Cache.RequestCacheLevel.Default> as their cache policy level. Using the <xref:System.Net.Cache.RequestCacheLevel.Default> level, the effective cache policy is determined by the current cache policy and the age of the content in the cache. The <xref:System.Net.WebRequest.CachePolicy?displayProperty=nameWithType> property, if not `null`, determines the cache policy in effect for a request.

The default policy for the application domain can be set using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy*> or the application or machine configuration file. For more information, see [&lt;requestCaching&gt; Element (Network Settings)](/dotnet/framework/configure-apps/file-schema/network/requestcaching-element-network-settings).



## Examples
The following code example creates a <xref:System.Net.Cache.RequestCacheLevel.CacheOnly> policy and sends a request.

:::code language="csharp" source="~/snippets/csharp/System.Net/WebRequest/CachePolicy/example.cs" id="Snippet13":::
You can set the default policy using the <xref:System.Net.HttpWebRequest.DefaultCachePolicy> property.

]]></format>
</remarks>
Expand Down
Loading
Loading