Pe16, We've only seen database sizes increase on the iPhone (and localStorage is implemented with a sqlite database). In the webkit code, there's a way to run the VACUUM sql command, which reduces the file size by eliminating unused space, but I don't think that's exposed to Javascript -- at least, not yet.
On the iPhone, we couldn't get localStorage to prompt the user to increase the quota when the limit was reached. In the end, we put all the large items in the WebDatabase (which makes your calling code a mess of callbacks because at present it only has an async API). But also note that the WebDatabase only prompts the user to increase the quota when running the app in Safari Mobile mode, not in "standalone" mode once it's been saved to the homescreen. So on QUOTA_EXCEEDED, if we're in standalone mode, we open the app in a Safari window. Also note that the quota rules don't work as you would expect (you request a certain amount of space for a particular database, but it applies to all databases from that domain -- it took quite a while to figure out the details & the thinking behind it, quite counter-intuitive and undocumented, I should blog the details sometime). In the end, we found that it worked best for our app to request the full 50mb for a "dummy" database right off the bat and then all subsequent databases didn't request an amount, so the 50mb of the domain automatically applied to them. -- peter rust Developer, Cornerstone Systems -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of .:: Pe16::. Sent: Friday, September 03, 2010 3:48 AM To: iPhoneWebDev Subject: QUOTA_EXCEEDED_ERR Anybody solved the QUOTA_EXCEEDED_ERR bug? It happens on the ipad. After a google researh it seems that local/ session Storage is responsible for that. I thought i solved the issue using a patch like the one below, so before setting any storage the classic way (setItem) i would first detelete that same key function setSessionkey(key, val) { sessionStorage.removeItem(key); sessionStorage.setItem(key, val); } function setLocalkey(key, val) { localStorage.removeItem(key); localStorage.setItem(key, val); } But, again the QUOTA_EXCEEDED_ERR lives. Anyone? -- You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en. -- You received this message because you are subscribed to the Google Groups "iPhoneWebDev" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/iphonewebdev?hl=en.
