How To Write Webpage To Cache?
Solution 1:
If you are ok with using Webview then LOAD_NORMAL is for u.
webView.getSettings().setCacheMode(WebSettings.LOAD_NORMAL); webView.loadUrl(HELPER.SERVER_BASE_LINK + "ads/s_image" + (i+1) + ".jpg");
It uses cache to load the webpage unless the page is modified, which is also mentioned in the description of setCacheMode();
http://developer.android.com/reference/android/webkit/WebSettings.html#setCacheMode%28int%29
It takes a few minutes (within 5) to reload the modified page. It is probably the poling time of Android for checking expired pages. I have tried it myself, but I felt bugs in it, sometimes it just doesn't load the cache. It might be that android is taking my cache back too quickly, which is usually not the case.
Using cache with browsers will have some similar method.
Post a Comment for "How To Write Webpage To Cache?"