We have developed an ionic app, which has a master and a detail view. The master view mainly consists of a ion-slide-box with many images as slides. The images are css background images loaded from a web server.
Now, the problem is, every time we go back from the detail view to the master view, the view gets rerendered completely and all the images get reloaded which makes it very slow.
We have implemented some image caching on the client and on the server (using ETags) with some improvements, however we are still not satisfied with the solution.
Are there any suggestions for best practices on this toppic?
Any help is greatly appreciated.
Thank you!
Dominik
I think I’ve narrowed it down via the imgcache.js file. The files cache as normal with <img src="link here" /> When I use the <img ng-src="{{image-link}}" /> format, it doesn’t recognize it. The example works but, it uses the first format.
Using javascripts native Image object, you could preload images and thus make rendering faster, even when removing them from the dom they will remain in memory:
Usage is simple as discribed in following resource:
This is very easy to implement, you could for example in your application’s run command load all the image urls that you’re going to load I think it will “cache” them for as long as the app runs (or rather: the image object exists) but I don’t think it will “cache” them between different startups of the app.
Hi All. Can anyone helps me. ?
I am build application using ionic, cordova.
I get data from external source and want to cache images for offline mode.
I try to use this https://github.com/chrisben/imgcache.js and this https://github.com/sunsus/ngImgCache. That i have read above. It seams to me cashed. But when i try run app for testing on Ipad. It does not launch. It starts but nothing showing (just black screen)? Are any ideas?
P.S sorry for my bad english
Hi @whsconcepts - Storage was a non issue for how I had designed the app. I would cache the images and refresh when the app was updated by the user. Not sure if that helps.