Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import android.webkit.ValueCallback
import android.webkit.WebChromeClient
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebSettings
import android.webkit.WebView
import android.webkit.WebViewClient
import android.widget.Toast
Expand Down Expand Up @@ -165,6 +166,7 @@ fun DeviceWebView(

settings.javaScriptEnabled = true
settings.domStorageEnabled = true
settings.cacheMode = WebSettings.LOAD_NO_CACHE
Comment on lines 168 to +169
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Disabling the cache completely might have a negative impact on performance. Consider if there's a way to selectively disable caching only for the specific requests that cause the 302 redirect issue, or to invalidate the cache for those resources after the redirect. Could you investigate if setting specific cache control headers on the server-side would be a better approach?

Suggested change
settings.domStorageEnabled = true
settings.cacheMode = WebSettings.LOAD_NO_CACHE
// settings.cacheMode = WebSettings.LOAD_NO_CACHE // Consider a more targeted approach to caching


setDownloadListener { url, _, contentDisposition, mimetype, _ ->
downloadListener(device, url, contentDisposition, mimetype, currentContext)
Expand Down