Is it possible to cache a list of website urls, image urls etc without opening them first in a webview? I have a list of img urls coming from a feed that i want to cache on download. i have already posted a question about this but have gotten no response here is my previous question. (https://stackoverflow.com/questions/21831464/cache-image-urls-android)
Asked
Active
Viewed 126 times
0
-
1This is how: http://stackoverflow.com/questions/541966/how-do-i-do-a-lazy-load-of-images-in-listview – Hassaan Rabbani Feb 18 '14 at 10:33
1 Answers
1
It's not possible to drop things into the WebView's cache directly. The only way that would not require preloading in an "off-screen" WebView (which is totally possible, btw.) would be to download the images yourself and serve them back to the WebView using shouldInterceptRequest.
I would recommend caution with the shouldInterceptRequest-based approach though. It's easy to hurt performance when using shouldInterceptRequest (see here). Also, you need to take care of removing stale images from your 'cache'.

Community
- 1
- 1

marcin.kosiba
- 3,221
- 14
- 19