Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

IOS5.1 Cleans out local databases randomly

It appears that not only does the IOS Updates erase local storage (webkit or HTML5 local storage) but now it is randomly going about cleaning out local databases when it needs more room. The file location for local storage has been moved into a new area it appears and this is now fair game for the clean-up routines.


This essentially prohibits any developer of WebKit applications to use the local device for persistant information such as settings. A real showstopper for WebKit based applications.

iOS 5.1

Posted on Mar 23, 2012 6:56 AM

Reply
16 replies

Mar 25, 2012 4:31 PM in response to etresoft

About half way down the page:


The second storage mechanism is designed for storage that spans multiple windows, and lasts beyond the current session. In particular, Web applications may wish to store megabytes of user data, such as entire user-authored documents or a user's mailbox, on the client side for performance reasons.


Again, cookies do not handle this case well, because they are transmitted with every request.


The localStorage IDL attribute is used to access a page's local storage area.


So who is the 'user' in this case? Apple or the programmer?

Mar 25, 2012 5:08 PM in response to aesculus

That is from the introduction, which explicity says "This section is non-normative". That means it is just an example. Nothing in it should be considered part of the standard.


The idea behind local storage is to make the web site run more quickly because it doesn't have to exchange everything between the client and server with every request. But if the user switches to some other program or site, or quits the web browser, all bets are off. It is the web site's responsibility to upload any local changes to the server. Generally, you will have a login and a logout procedure that will synchronize data. You can't assume the data is always there. Consider the use case of interacting with a web site and then switching to a different machine or device. In that case, you want to be able to pick up where you left off. Ergo, your site cannot assume that any local data will be available. It needs to be able to initialize its state from nothing and it must save state before going idle.

Mar 25, 2012 5:42 PM in response to etresoft

Well then what about this statement from Apples own development site?


If you want to learn more about JavaScript database support, then you should read:

Safari Client-Side Storage and Offline Applications Programming Guide, which describes a simple relational database that you can use to store persistent data in JavaScript that cannot be stored in cookies.

http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Referenc e/SafariWebContent/Introduction/Introduction.html

Jul 22, 2012 12:10 PM in response to alok_bunty2002

But what if someone accesses your web site from a different computer? Where is their data? Local storage is cache. If a user logs into your web site and has local data, everything should load quickly. If they don't have local data then it is your responsibility to initialize it from your server. When your application runs, it uses local storage. At logout or after an idle period it should flush changes to the server.

Jul 22, 2012 12:18 PM in response to etresoft

No thats not what "localStorage" is for as per HTML5. Please see link https://developer.apple.com/library/safari/#documentation/iPhone/Conceptual/Safa riJSDatabaseGuide/Name-ValueStorage/Name-ValueStorage.html#//apple_ref/doc/uid/T P40007256-CH6-SW1 and read key-value pair for details on localStorage. Its meant for persistance but ios5.1 webkit is in violation of this feature of html 5. I was wondering if safari browser on ios5.1 also has the same violation or this violation is restricted to only webkit.

Jul 22, 2012 1:48 PM in response to alok_bunty2002

alok_bunty2002 wrote:


No thats not what "localStorage" is for as per HTML5.

That is not a standards document. This is: http://www.whatwg.org/specs/web-apps/current-work/multipage/


Take a look at section 11.2.3 where it reads:


User agents should expire data from the local storage areas only for security reasons or when requested to do so by the user.


Not only is your local storage never guaranteed, it can be deleted at any time by the user. It is a cache meant for a web app to be used offline.

IOS5.1 Cleans out local databases randomly

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.