Can Android WebView revalidate a single cached URL without clearing the entire HTTP cache?
0 reputation · 28 Sept 2020, 04:53 UTC
Goal
Force an Android WebView to revalidate one specific https:// URL against the origin before displaying it, while leaving unrelated cached responses in the app's HTTP cache untouched.
Constraints
WebView honors standard HTTP freshness headers, and Chromium may serve stale entries under cache modes such as LOAD_CACHE_ELSE_NETWORK. Public APIs appear limited to whole-cache operations like clearCache(true), which targets the calling app's entire cache and may complete asynchronously on older API levels. Behavior can also vary across system WebView versions and Android releases.
Is there a stable public WebView API or WebSettings combination that forces conditional revalidation for a single URL without evicting unrelated cached responses? If no such API exists, what is the supported per-URL alternative? How does this behavior differ between stock and updated system WebView versions?