Notification texts go here Contact Us Buy Now!

Do the webview in flutter cached web page?

Does the WebView in Flutter Cache Web Pages?

Yes, the WebView in Flutter can cache web pages, depending on the specific WebView implementation you are using. Here's a summary of the caching capabilities of different WebView plugins in Flutter:

flutter_inappwebview (former flutter_inappbrowser)

This plugin provides a cacheEnabled parameter with a default value of true. Setting cacheEnabled to true enables browser caching for the WebView.

flutter_webview_plugin community version

This plugin has an appCacheEnabled parameter that you can set to true to enable caching. Here's an example of how to use it:

WebviewScaffold(
    key: _scaffoldKey,
    url: widget.url,
    clearCache: true,
    appCacheEnabled: true,      
);
webview_flutter official version

This plugin does not provide a specific parameter for controlling caching. However, you can check the Android source code to see how caching is handled.

By default, the caching behavior of the WebView depends on the underlying platform-specific implementation (iOS WKWebView and Android WebView).

Default Caching Mode

The default cache mode for Android WebView is LOAD_DEFAULT, which means that cached resources will be used when available and not expired. Otherwise, resources will be loaded from the network.

The default cache mode for iOS WKWebView is also to use cached resources when available and not expired. Additionally, WKWebView uses a disk cache to store frequently visited pages for offline access.

To summarize, the WebView in Flutter can cache web pages, but the specific caching behavior depends on the WebView plugin you are using and the platform-specific implementation.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.