BackForwardCacheSettings


@WebSettingsCompat.ExperimentalBackForwardCacheSettings
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

Public functions

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 functions

getMaxPagesInCache

fun getMaxPagesInCache(): Int

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

getTimeoutSeconds

fun getTimeoutSeconds(): Long

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