[FIXED] Ionic Android app stops storing after cache reaches 10.3MB

Issue

I built an Ionic app for a client that enables him to take pictures and store them with LocalStorageService. He reports that once the app’s cache reaches 10.3 MB, pictures that he take are no longer stored.

Once deleting the application’s cache, he wipes all the pictures he took and can resume adding new pictures.

I try this on my device and cannot replicate the issue. I am using a Samsung S6 with Marshmallow while the client is using a cheap tablet running Lollipop. Am I missing something here?

Solution

LocalStorage is not meant to store files of size in MBs or files at all (certainly not images). Most of the time, Chrome provides 10MB of space and Firefox provides 5MB (based on this article). However, it is not guaranteed as it’s not specified in their documentation. They can be anywhere from 2 MB – unlimited.

I am using a Samsung S6 with Marshmallow while the client is using a cheap tablet running Lollipop. Am I missing something here?

You can use File Transfer Plugin and store the image files on your device. Once you do that, you can then use LocalStorage or SQLite to keep track of the path of the image the user downloaded.

Answered By – Prashant G

Answer Checked By – Cary Denson (Easybugfix Admin)

Leave a Reply

(*) Required, Your email will not be published