PrefetchParameters


@Profile.ExperimentalUrlPrefetch
public final class PrefetchParameters


Parameters for customizing the prefetch. Use the Builder to construct.

Summary

Nested types

public final class PrefetchParameters.Builder

A builder class for constructing PrefetchParameters instances.

Public methods

@NonNull Map<String, String>

Returns the map of additional HTTP headers to be sent with the prefetch request.

@Nullable NoVarySearchHeader

This method is deprecated.

This is just an update in naming, and this method will disappear in a future release.

@Nullable NoVarySearchHeader

Returns the expected No-Vary-Search header data used to match subsequent navigations to this prefetch.

boolean

Returns whether the prefetch request will include client hints.

@Nullable Integer

Returns the variations ID associated with this prefetch request, if any.

boolean

This method is deprecated.

This method has been renamed to getShouldSendClientHints and will be removed in a future release.

Public methods

getAdditionalHeaders

Added in 1.17.0
public @NonNull Map<String, String> getAdditionalHeaders()

Returns the map of additional HTTP headers to be sent with the prefetch request.

getExpectedNoVarySearchData

Added in 1.17.0
Deprecated in 1.17.0
public @Nullable NoVarySearchHeader getExpectedNoVarySearchData()

Returns the expected No-Vary-Search header data used to match subsequent navigations to this prefetch.

getExpectedNoVarySearchHeader

Added in 1.17.0
public @Nullable NoVarySearchHeader getExpectedNoVarySearchHeader()

Returns the expected No-Vary-Search header data used to match subsequent navigations to this prefetch.

getShouldSendClientHints

Added in 1.18.0-rc01
public boolean getShouldSendClientHints()

Returns whether the prefetch request will include client hints. See setShouldSendClientHints.

getVariationsId

Added in 1.17.0
public @Nullable Integer getVariationsId()

Returns the variations ID associated with this prefetch request, if any.

isJavaScriptEnabled

Added in 1.17.0
Deprecated in 1.18.0-rc01
public boolean isJavaScriptEnabled()

Returns whether JavaScript is enabled for the prefetch, which influences the sending of client hints.