Before digging into this topic tonight, I knew that data stored using localStorage may not be as persistent as other options. But what I didn’t know, was how persistent is it? Will a user clearing his or her web browser cache cause my app to lose data? What about clearing cached data for all applications under settings? How about specifically clearing cached data for my app specifically? Or clearing all data for my app specifically? Well now after a little experimentation and research, I think I have a pretty good answer!
- Clearing “browsing data” on Chrome for Android will not cause your Cordova app to lose localStorage data.
- Clearing “cached data” for all apps under Settings on Android will not cause your Cordova to lose localStorage data either.
- Selecting the “clear cache” option for your app specifically will not cause your Cordova app to lose data.
- SELECTING THE “CLEAR DATA” OPTION FOR YOUR APP SPECIFICALLY WILL CAUSE YOUR CORDOVA APP TO LOSE DATA.