Is there a size limit for LocalShared Objects crea

2019-07-26 07:33发布

For a mobile app project I am caching lot of data for offline use into the app.

So far I've been using Classic SharedObjects, storing every data in a couple of fat xmls (as strings in SharedObjects). The images are saved through the FileSystem Class.

I'm now wondering if it is good practice or if I should write my xmls in Files rather than Shared Objects.

My SharedObject's size is 3.6 Mo.

Thanks :)

1条回答
小情绪 Triste *
2楼-- · 2019-07-26 08:18

In AIR, it is generally recommended (by developers on here and the Adobe forums as well as the occasional Adobe evangelist) that you avoid using SharedObject entirely. It's meant to be used as a way to store files in a browser's temp file directory. With AIR, you are given far more control using the File and FileStream classes.

As for a size limit, the docs state the max size for a SharedObject is 100 kb. That is, as far as I know, a soft limit. It varies based on client, but it should always be around 100 kb. This is one of the main reasons why it is recommended you use the File and FileStream classes - there is no size limit (beyond the 4GB max file size for a 32 bit system, obviously). You also have full control over the location of the object, the life cycle of it, the security of it, etc.

In short, I highly recommend switching to using the File and FileStream classes when using AIR and use SharedObject only when working with a browser-based SWF

查看更多
登录 后发表回答