ng-src="http_url_image"
I am storing data from server on Local Store, but about the images, I would like to store them on cache while the user is offline.
Do the Cache store them automatically?
I found a duplicated question, but It didn't solve my question, because I want only to cache my images because my data will be updated when the network is back.
Are cached images loaded by the browser when offline?
Asked
Active
Viewed 403 times
1

Community
- 1
- 1

Angela Pat.
- 37
- 2
- 9
-
Maybe you can use application cache manifest - read more about it here https://developer.mozilla.org/en-US/docs/Web/HTML/Using_the_application_cache I am using it for my offline app with angular and it's working :) It got it's gotyas so watch out (update manifest file every time you change somethin - add version counter in beging of file) – Jacob Sobus Jun 08 '16 at 11:31
-
This sounds really good, but I am getting wrong I think. the thing is: I get the data from backend that comes with images. With local store I can keep them and the difference between local storage and application cache manifest, app cache manifest : the user can refresh the page while is offline. am I right? I am using local storage because i can update whenever i want my object, and the user is offline. and about the images I think only to cache images . May you explain a difference between both for you. Would be nice . thanks for your answer. – Angela Pat. Jun 08 '16 at 12:40
-
Application cache manifest is good only for caching static images you cant dynamically add new ones to it. Adding new images = editing manifest file on server. For storing dynamically you need to use some other storage for it. For such thing I was using IndexedDB with blobs there, problem is not all of the browsers implement it. Other kind of nice storage is FilesystemAPI but again not all browsers use it. You can use Local storage with base64 of images so firstly save it there then add load as a src of img tag. – Jacob Sobus Jun 08 '16 at 14:12
-
Thanks again. Okay I can work with local storage base 64 in a future , but just last question: any image is stored by default in a cache browser isn't it? if it is that case I prefer to work with the cache browser and then in a future implement local storage base64. And I discovered that `ngLocalstorage` doesn't have a function to check Synchronisations. – Angela Pat. Jun 08 '16 at 15:20
-
Finally this answer is valid: http://stackoverflow.com/questions/23652183/makes-angular-js-works-offline so it says that even if file is cached in browser, after refresh client ask server for "304 Not Modified". Cache manifest is for that things, read accepted answer there and store dynamic images in some kind of "persistent" storage. – Jacob Sobus Jun 08 '16 at 19:57
-
Thanks :) , In the end I will work with the images stores in a cache browser. So far my task doesn't ask me this. Anyway I will implement this on a project made by own just to try, because looks really interesting. How I can give you points as a good answer? – Angela Pat. Jun 09 '16 at 08:22
-
In case this interests you. https://developers.google.com/speed/docs/insights/LeverageBrowserCaching – Angela Pat. Jun 09 '16 at 08:27