-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathHttpCacheVaryByParams.xml
More file actions
192 lines (175 loc) · 14.4 KB
/
Copy pathHttpCacheVaryByParams.xml
File metadata and controls
192 lines (175 loc) · 14.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
<Type Name="HttpCacheVaryByParams" FullName="System.Web.HttpCacheVaryByParams">
<TypeSignature Language="C#" Value="public sealed class HttpCacheVaryByParams" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit HttpCacheVaryByParams extends System.Object" />
<TypeSignature Language="DocId" Value="T:System.Web.HttpCacheVaryByParams" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class HttpCacheVaryByParams" />
<TypeSignature Language="F#" Value="type HttpCacheVaryByParams = class" />
<TypeSignature Language="C++ CLI" Value="public ref class HttpCacheVaryByParams sealed" />
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Object</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Provides a type-safe way to set the <see cref="P:System.Web.HttpCachePolicy.VaryByParams" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
The <xref:System.Web.HttpCachePolicy.VaryByParams> property identifies which HTTP `GET` query string or `POST` form parameters ASP.NET uses to uniquely identify a variation of the response when there are multiple cached responses for a resource. This is useful when a response depends on a set of client inputs, such as query string values or form fields. In this way, `VaryByParams` lets the output cache store and serve the appropriate representation of a resource for a given request.
> [!IMPORTANT]
> Output caching is a performance optimization feature. The `VaryBy` settings are designed to cache alternate representations of a resource based on request characteristics; they are not designed to isolate audiences or classes of content. Do not rely on cache variation to separate personalized, tenant-specific, authorization-dependent, or otherwise sensitive responses. Enforce any required isolation between request contexts independently of the cache configuration.
The <xref:System.Web.HttpCacheVaryByParams> is not directly related to HTTP cache-control headers, but helps ensure that a client or proxy varies by the specified parameters. For more information about `VaryByParams`, see RFC 2616: Hypertext Transfer Protocol -- HTTP/1.1, available on the [World Wide Web Consortium (W3C) Web](https://go.microsoft.com/fwlink/?linkid=37125) site. See section 14, "Header Field Definitions", for complete details.
## Examples
The following code example demonstrates how the <xref:System.Web.HttpCacheVaryByParams> object is accessed from the <xref:System.Web.HttpCachePolicy> object associated with an <xref:System.Web.HttpResponse>.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.Cache Example/CS/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.Cache Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="P:System.Web.HttpCachePolicy.VaryByParams" />
<altmember cref="T:System.Web.UI.BasePartialCachingControl" />
<altmember cref="T:System.Web.UI.StaticPartialCachingControl" />
<altmember cref="T:System.Web.HttpCacheVaryByHeaders" />
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/xadzbzd6(v=vs.100)">Caching Multiple Versions of a Page</related>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public HttpCacheVaryByParams ();" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor() cil managed" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpCacheVaryByParams.#ctor" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="VB.NET" Value="Public Sub New ()" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="C++ CLI" Value="public:
 HttpCacheVaryByParams();" FrameworkAlternate="netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters />
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Web.HttpCacheVaryByParams" /> class.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="GetParams">
<MemberSignature Language="C#" Value="public string[] GetParams ();" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance string[] GetParams() cil managed" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpCacheVaryByParams.GetParams" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="VB.NET" Value="Public Function GetParams () As String()" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="C++ CLI" Value="public:
 cli::array <System::String ^> ^ GetParams();" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberSignature Language="F#" Value="member this.GetParams : unit -> string[]" Usage="httpCacheVaryByParams.GetParams " FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">System.String[]</ReturnType>
</ReturnValue>
<Parameters />
<Docs>
<summary>Gets an array of values which specify the HTTP <see langword="GET" /> or <see langword="POST" /> parameters to be used for varying the cache.</summary>
<returns>An array of values which contain the HTTP <see langword="GET" /> or <see langword="POST" /> parameters for varying the cache.</returns>
<remarks>To be added.</remarks>
</Docs>
</Member>
<Member MemberName="IgnoreParams">
<MemberSignature Language="C#" Value="public bool IgnoreParams { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool IgnoreParams" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpCacheVaryByParams.IgnoreParams" />
<MemberSignature Language="VB.NET" Value="Public Property IgnoreParams As Boolean" />
<MemberSignature Language="F#" Value="member this.IgnoreParams : bool with get, set" Usage="System.Web.HttpCacheVaryByParams.IgnoreParams" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool IgnoreParams { bool get(); void set(bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets a value indicating whether an HTTP response varies by <see langword="Get" /> or <see langword="Post" /> parameters.</summary>
<value>
<see langword="true" /> if HTTP request parameters are ignored; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><) directive `VaryByParams` attribute to "none" for the resource.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Item">
<MemberSignature Language="C#" Value="public bool this[string header] { get; set; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Item(string)" />
<MemberSignature Language="DocId" Value="P:System.Web.HttpCacheVaryByParams.Item(System.String)" />
<MemberSignature Language="VB.NET" Value="Default Public Property Item(header As String) As Boolean" />
<MemberSignature Language="F#" Value="member this.Item(string) : bool with get, set" Usage="System.Web.HttpCacheVaryByParams.Item" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool default[System::String ^] { bool get(System::String ^ header); void set(System::String ^ header, bool value); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>1.0.5000.0</AssemblyVersion>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="header" Type="System.String" />
</Parameters>
<Docs>
<param name="header">The name of the custom parameter.</param>
<summary>Gets or sets a value indicating whether the cache varies according to the specified HTTP request parameter.</summary>
<value>
<see langword="true" /> if the cache should vary by the specified parameter value.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
When used as an accessor (getter), the <xref:System.Web.HttpCacheVaryByParams.Item%2A> indexer returns `true` if a value for the specified parameter is found in the current parameters collection, or if the collection is set to vary by * (an asterisk), which indicates all parameters.
When used as a mutator (setter), the <xref:System.Web.HttpCacheVaryByParams.Item%2A> indexer sets the value for the parameter in the parameters collection that corresponds to the specified header to `true`. The value * can be specified, which indicates all parameters.
## Examples
The following code example demonstrates how the <xref:System.Web.HttpCacheVaryByParams.Item%2A> indexer is accessed from the <xref:System.Web.HttpCachePolicy> object associated with an <xref:System.Web.HttpResponse>.
:::code language="csharp" source="~/snippets/csharp/VS_Snippets_WebNet/Classic HttpResponse.Cache Example/CS/source.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_WebNet/Classic HttpResponse.Cache Example/VB/source.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">
<paramref name="header" /> is <see langword="null" />.</exception>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/y96218s9(v=vs.100)">How to: Cache Versions of a Page, Based on Parameters</related>
<related type="Article" href="https://learn.microsoft.com/previous-versions/aspnet/xadzbzd6(v=vs.100)">Caching Multiple Versions of a Page</related>
</Docs>
</Member>
<Member MemberName="SetParams">
<MemberSignature Language="C#" Value="public void SetParams (string[] parameters);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig instance void SetParams(string[] parameters) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Web.HttpCacheVaryByParams.SetParams(System.String[])" />
<MemberSignature Language="VB.NET" Value="Public Sub SetParams (parameters As String())" />
<MemberSignature Language="F#" Value="member this.SetParams : string[] -> unit" Usage="httpCacheVaryByParams.SetParams parameters" />
<MemberSignature Language="C++ CLI" Value="public:
 void SetParams(cli::array <System::String ^> ^ parameters);" />
<MemberType>Method</MemberType>
<AssemblyInfo>
<AssemblyName>System.Web</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<ReturnValue>
<ReturnType>System.Void</ReturnType>
</ReturnValue>
<Parameters>
<Parameter Name="parameters" Type="System.String[]" Index="0" FrameworkAlternate="netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1" />
</Parameters>
<Docs>
<param name="parameters">An array of values which contain the HTTP <see langword="GET" /> or <see langword="POST" /> parameters for varying the cache.</param>
<summary>Sets an array of values which specify the HTTP <see langword="GET" /> or <see langword="POST" /> parameters to be used for varying the cache.</summary>
<remarks>To be added.</remarks>
</Docs>
</Member>
</Members>
</Type>