BackForwardCacheSettings


@WebSettingsCompat.ExperimentalBackForwardCacheSettings
public class BackForwardCacheSettings


A class for developers to configure the back-forward cache on a android.webkit.WebView.

The back-forward cache is a browser feature that improves the user experience by keeping pages alive for a limited time after the user navigates away from them. If the user navigates back or forward, the page is reused for a fast back navigation.

Example:

WebSettingsCompat.setBackForwardCacheSettings( webView.getSettings(), new BackForwardCacheSettings.Builder() .setTimeoutInSeconds(600) .setMaxPagesInCache(10) .build());

Summary

Nested types

Builder for BackForwardCacheSettings.

Public methods

int

Returns the maximum number of pages that can be stored in the back-forward cache.

long

Returns the timeout for pages in the back-forward cache, in seconds.

Public methods

getMaxPagesInCache

public int getMaxPagesInCache()

Returns the maximum number of pages that can be stored in the back-forward cache.

getTimeoutSeconds

public long getTimeoutSeconds()

Returns the timeout for pages in the back-forward cache, in seconds.