Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

OutputCachePolicyBuilder.SetVaryByQuery Method

Definition

Namespace:
Microsoft.AspNetCore.OutputCaching
Assembly:
Microsoft.AspNetCore.OutputCaching.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
SetVaryByQuery(String[])

Adds a policy to vary the cached responses by query strings.

SetVaryByQuery(String, String[])

Adds a policy to vary the cached responses by query strings.

SetVaryByQuery(String[])

Source:
OutputCachePolicyBuilder.cs

Adds a policy to vary the cached responses by query strings.

public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder SetVaryByQuery(string[] queryKeys);
member this.SetVaryByQuery : string[] -> Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder
Public Function SetVaryByQuery (queryKeys As String()) As OutputCachePolicyBuilder

Parameters

queryKeys
String[]

The query keys to vary the cached responses by.

Returns

Remarks

By default all query keys vary the cache entries. However when specific query keys are specified only these are then taken into account.

Applies to

SetVaryByQuery(String, String[])

Source:
OutputCachePolicyBuilder.cs

Adds a policy to vary the cached responses by query strings.

public Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder SetVaryByQuery(string queryKey, params string[] queryKeys);
member this.SetVaryByQuery : string * string[] -> Microsoft.AspNetCore.OutputCaching.OutputCachePolicyBuilder
Public Function SetVaryByQuery (queryKey As String, ParamArray queryKeys As String()) As OutputCachePolicyBuilder

Parameters

queryKey
String

The query key to vary the cached responses by.

queryKeys
String[]

The extra query keys to vary the cached responses by.

Returns

Remarks

By default all query keys vary the cache entries. However when specific query keys are specified only these are then taken into account.

Applies to


Feedback

Was this page helpful?