# PrefetchParameters

Artifact: [androidx.webkit:webkit](https://developer.android.com/jetpack/androidx/releases/webkit) [View Source](https://cs.android.com/search?q=file:androidx/webkit/PrefetchParameters.java+class:androidx.webkit.PrefetchParameters) Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

*** ** * ** ***


```
@Profile.ExperimentalUrlPrefetch
public final class PrefetchParameters
```

<br />

*** ** * ** ***

Parameters for customizing the prefetch. Use the `https://developer.android.com/reference/androidx/webkit/PrefetchParameters.Builder` to construct.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/webkit/PrefetchParameters.Builder` A builder class for constructing `https://developer.android.com/reference/androidx/webkit/PrefetchParameters` instances. |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/java/lang/String.html>` | `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getAdditionalHeaders()()` Returns the map of additional HTTP headers to be sent with the prefetch request. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/webkit/NoVarySearchHeader` | `[getExpectedNoVarySearchData](https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getExpectedNoVarySearchData())()` **This method is deprecated.** This is just an update in naming, and this method will disappear in a future release. <br /> |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/webkit/NoVarySearchHeader` | `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getExpectedNoVarySearchHeader()()` Returns the expected No-Vary-Search header data used to match subsequent navigations to this prefetch. |
| `boolean` | `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getShouldSendClientHints()()` Returns whether the prefetch request will include client hints. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Integer.html` | `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getVariationsId()()` Returns the variations ID associated with this prefetch request, if any. |
| `boolean` | `[isJavaScriptEnabled](https://developer.android.com/reference/androidx/webkit/PrefetchParameters#isJavaScriptEnabled())()` **This method is deprecated.** This method has been renamed to `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getShouldSendClientHints()` and will be removed in a future release. <br /> |

## Public methods

### getAdditionalHeaders

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#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](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0) Deprecated in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
public @Nullable NoVarySearchHeader [getExpectedNoVarySearchData](https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getExpectedNoVarySearchData())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> This is just an update in naming, and this method will disappear in a future release. Use `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getExpectedNoVarySearchHeader()` instead.

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

### getExpectedNoVarySearchHeader

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#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](https://developer.android.com/jetpack/androidx/releases/webkit#1.18.0)

```
public boolean getShouldSendClientHints()
```

Returns whether the prefetch request will include client hints. See `https://developer.android.com/reference/androidx/webkit/PrefetchParameters.Builder#setShouldSendClientHints(boolean)`.

### getVariationsId

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0)

```
public @Nullable Integer getVariationsId()
```

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

### isJavaScriptEnabled

Added in [1.17.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.17.0) Deprecated in [1.18.0](https://developer.android.com/jetpack/androidx/releases/webkit#1.18.0)

```
public boolean [isJavaScriptEnabled](https://developer.android.com/reference/androidx/webkit/PrefetchParameters#isJavaScriptEnabled())()
```

> [!CAUTION]
> **This method is deprecated.**   
>
> This method has been renamed to `https://developer.android.com/reference/androidx/webkit/PrefetchParameters#getShouldSendClientHints()` and will be removed in a future release.

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