user246114
user246114

Reputation: 51661

Will WebView cache persist between application runs?

I have a WebView. I'm not quite sure how caching works for it. Ideally I'd like to load a webpage from the network once (images included), then from then on only ever load it from the local cache. I'm not sure if we have this level of control over webview. Will it at some point just auto-clear the cache? How could I tell? I need to be sure that it's really keeping the page cached between different runs of my application.

http://developer.android.com/reference/android/webkit/WebSettings.html

the cache modes there don't seem to specify if the cache persists between runs of the application or not?

Thanks

Upvotes: 5

Views: 3078

Answers (1)

Pentium10
Pentium10

Reputation: 207982

Check out the cache folder in your apk's data directory

in a command prompt run

adb shell
#cd /data/data/yourpackage
#ls
<<you should see a cache directory>>

Upvotes: 1

Related Questions