Implementation guide
Website configuration
To force the app to load the latest version of your assets (for example, JavaScript or CSS files), you can use file versioning like:JavaScript Bridge method
Median provides a JavaScript command to programmatically clear the webview cache. This is especially useful during development or when troubleshooting cache-related display issues. To clear the cache, call:Android-only
Some configuration options inappConfig.json apply specifically to Android apps. These settings allow you to control WebView behavior, including caching.
Automatically clear cache on exit
Median includes a configuration option for Android apps to clear the WebView cache every time the app exits. To enable this, add the following in the appConfig.json:Configure WebView cache mode
You can also control how the Android WebView handles caching by setting the cacheMode option. Add the following under the general section in your appConfig.json:Frequently asked questions
Why are my website updates not appearing in my Median app?
Why are my website updates not appearing in my Median app?
Your app may still be loading cached website assets, such as older JavaScript, CSS, image, or HTML files. Median apps respect your website’s cache headers, so your server configuration controls how long those assets remain cached in the app.
Should I call median.webview.clearCache() every time the app starts?
Should I call median.webview.clearCache() every time the app starts?
Usually, no. Clearing the cache too often can reduce performance because the app may need to re-download assets that would otherwise load quickly from cache. For production apps, asset versioning and correct cache headers are usually better long-term solutions.
Does clearing the WebView cache sign users out?
Does clearing the WebView cache sign users out?
Don’t assume either way. This page doesn’t confirm whether cookies, local storage, or authentication sessions are affected, so test sign-in behavior in your app before using this in production.
Which Android cache mode should I choose?
Which Android cache mode should I choose?
Use
default for normal production behavior. Use no_cache when you need Android to always load from the network during testing or troubleshooting. Use cache_only only for specialized offline scenarios, and use cache_else_network when cached content should be preferred if available.