NoVarySearchHeader


@Profile.ExperimentalUrlPrefetch
class NoVarySearchHeader


The No-Vary-Search header specifies a set of rules that define how a URL's query parameters will affect cache matching. These rules dictate whether the same URL with different URL parameters should be saved as separate browser cache entries.

See Doc here to learn more about No-Vary-Search.

Summary

Public functions

java-static NoVarySearchHeader

Returns No-Vary-Search header that considers all differences in query parameters (i.e. presence and ordering) between otherwise identical URLs in cache matching.

java-static NoVarySearchHeader
@Profile.ExperimentalUrlPrefetch
neverVaryExcept(
    varyOnOrdering: Boolean,
    consideredQueryParameters: (Mutable)List<String!>
)

Returns No-Vary-Search header that doesn't consider differences in in query parameters present between otherwise identical URLs in cache matching with the exception of the ones provided in consideredQueryParameters.

java-static NoVarySearchHeader

Returns No-Vary-Search header that doesn't consider any differences in query parameters (i.e. presence or ordering) between otherwise identical URLs in cache matching.

java-static NoVarySearchHeader
@Profile.ExperimentalUrlPrefetch
varyExcept(
    varyOnOrdering: Boolean,
    ignoredQueryParameters: (Mutable)List<String!>
)

Returns No-Vary-Search header that considers differences in in query parameters present between otherwise identical URLs in cache matching with the exception of the ones provided in ignoredQueryParameters.

Public properties

(Mutable)List<String!>

A List of parameters that if present, will cause otherwise identical URLs to be cached as separate entries.

Boolean

A true to indicate the differences in parameters present between otherwise identical URLs will not cause them to be cached as separate entries.

(Mutable)List<String!>

A List of parameters that if present, will not cause otherwise identical URLs to be cached as separate entries.

Boolean

If true this indicates that differences in the order of parameters between otherwise identical URLs will cause them to be cached as separate entries.

Public functions

alwaysVaryHeader

Added in 1.13.0-beta01
@Profile.ExperimentalUrlPrefetch
java-static fun alwaysVaryHeader(): NoVarySearchHeader

Returns No-Vary-Search header that considers all differences in query parameters (i.e. presence and ordering) between otherwise identical URLs in cache matching.

neverVaryExcept

Added in 1.13.0-beta01
@Profile.ExperimentalUrlPrefetch
java-static fun neverVaryExcept(
    varyOnOrdering: Boolean,
    consideredQueryParameters: (Mutable)List<String!>
): NoVarySearchHeader

Returns No-Vary-Search header that doesn't consider differences in in query parameters present between otherwise identical URLs in cache matching with the exception of the ones provided in consideredQueryParameters.

Parameters
varyOnOrdering: Boolean

true if the ordering of query parameters should be considered in cache matching, false otherwise.

consideredQueryParameters: (Mutable)List<String!>

the query parameters to consider in cache matching.

neverVaryHeader

Added in 1.13.0-beta01
@Profile.ExperimentalUrlPrefetch
java-static fun neverVaryHeader(): NoVarySearchHeader

Returns No-Vary-Search header that doesn't consider any differences in query parameters (i.e. presence or ordering) between otherwise identical URLs in cache matching.

varyExcept

Added in 1.13.0-beta01
@Profile.ExperimentalUrlPrefetch
java-static fun varyExcept(
    varyOnOrdering: Boolean,
    ignoredQueryParameters: (Mutable)List<String!>
): NoVarySearchHeader

Returns No-Vary-Search header that considers differences in in query parameters present between otherwise identical URLs in cache matching with the exception of the ones provided in ignoredQueryParameters.

Parameters
varyOnOrdering: Boolean

true if the ordering of query parameters should be considered in cache matching, false otherwise.

ignoredQueryParameters: (Mutable)List<String!>

the query parameters to ignore in cache matching.

Public properties

consideredQueryParameters

Added in 1.13.0-beta01
val consideredQueryParameters: (Mutable)List<String!>

A List of parameters that if present, will cause otherwise identical URLs to be cached as separate entries. Any parameters present in the URLs that are not included in this list will not affect cache matching.

This list is irrelevant and not used if ignoreDifferencesInParameters is false.

ignoreDifferencesInParameters

Added in 1.13.0-beta01
val ignoreDifferencesInParametersBoolean

A true to indicate the differences in parameters present between otherwise identical URLs will not cause them to be cached as separate entries. false otherwise.

ignoredQueryParameters

Added in 1.13.0-beta01
val ignoredQueryParameters: (Mutable)List<String!>

A List of parameters that if present, will not cause otherwise identical URLs to be cached as separate entries. Any parameters present in the URLs that are not included in this list will affect cache matching.

This list is irrelevant and not used if ignoreDifferencesInParameters is true.

varyOnKeyOrder

Added in 1.13.0-beta01
val varyOnKeyOrderBoolean

If true this indicates that differences in the order of parameters between otherwise identical URLs will cause them to be cached as separate entries.

However, differences in the parameters present will cause them to be cached separately regardless of this flag's value.

To ignore any differences in parameters present for caching see ignoreDifferencesInParameters and ignoredQueryParameters. false otherwise.