Suggestion method of caching image in ionic3


#1

I am using ionic3 with WKWebView(iOS and Android App), I want to storage the images get from server API, next time when the image path is same just load the local storage not render the url again.

Any suggestion or method to approach it, thanks a lot.


#2

You could Base64 encode your image and then store the string with Native Storage. You’ll have to manage a way to invalidate your caching system, though.


#3

Thanks for your reply, but my data is dynamic, and contain a lot of images. If each one encode to base64, I think the app will very slow.


#4

I’d suggest this:


#5

Thanks for your reply, I have try this. when my app offline, it can’t load the image locally.