views:

1414

answers:

5

It's becoming evident in my testing that there's a 5mb size limit on Mobile Safari's implementation of HTML5's application cache.

Does anyone know how to circumvent or raise this? Is there some unexposed meta tag that I should know about? I have to cache some video content for an offline app and 5mb is not going to be enough.

A: 

Only thing I can think of is to mod more memory to the phone. Local storage on mobile is a laughable concept, they're not full-blown computers and most of them aren't even "smart".

(This is purely an opinion but I'm very much willing to take any and all the reputation hit for it.)


Late edit: A bit further clarification, consider iPhone: Its browser allows the user to open up to 8 tabs at any time. It's first models has 128MB of RAM and newer models have 256MB of RAM. Now, allowing 5 megabytes per tab and 8 tabs mean that just the cached content may take up to 40 megabytes of those precious bits which is already quite a lot since I really doubt that the browser itself, not to mention phone's OS and other stuff hanging in memory wouldn't take a significant part of the memory already.

On top of that as long as even a single old-generation iPhone exists, Apple has to support it on software - it wouldn't be good for the image of the company (not that it'd be that great at all anyway currently) if some of their everyday products would just stop working all the sudden.

In short, it's just not feasible to allow local storage to expand beyond a few megabytes because phones just aren't capable to do that. Wait a couple of years and then maybe...

Esko
I did hear back from Apple on this also -- nutshell: "yes, there's a 5mb limit. We know. Don't try to work around it. You're welcome to submit a bug report if you'd like to see this addressed."
JFH
This doesn't have anything to do with RAM on the phone, only permanent storage. The resources stored in the cache only need to be loaded into memory when the currently loaded page requests them.
austinfromboston
@austin: Bits do not magically transfer from permanent storage to RAM, bandwidth and both read and write speeds are really important too. This situation wouldn't be any different even if iPhones had a full terabyte of permanent storage space since there's only so much space in RAM to use and transferring from permanent storage to RAM is always relatively slow.
Esko
A: 

What else is on the page?

These guys keep their pages under the limit by either splitting up the pages or replacing some of the cached images with links:
http://www.mobilenoter.com/blog/post/2010/04/06/Removing-size-limit-of-a-page.aspx

Leah
A: 

Not sure why every forgets about the good 'ol Web apps (remember these guys? they were around before native apps!), but they're already "offline ready," which means that you don't need to load up your application cache with every component of your app.

To the best of my knowledge, there is no limit to the size of web apps.

http://www.apple.com/webapps/

mattbasta
It's actually a web app that I'm building -- one to show movies (html5 video tag) when user is offline for presentations etc. I can confirm that the cache size limit applies to web apps as well.
JFH
A: 

I am trying to make a little animation player. The 5MB limit is not what is bothering me, but it is the inability to free up memory that you have already used. For example, if I load some images and display them, can I not release them afterward in order to load more? I am seeing a ~5MB limit even though I am deleting the image references. Why is that? It seems like all images are always being retained.

Thanks Bob

Bob S
A: 

In my experimentation, I found that setting an IMG element's src attribute to "" or to a 1x1 gif or something does release the memory used by the original image.

mini