On 05/09/2013, at 14:33, Honza Bambas wrote: > Should b2g have a global cache directory? Android has a folder whom path is > gived to an app via its Context (or what is the name of the interface). This > folder content or individual files can be in any time deleted by the OS > (android) when low on disk space. The data in it are considered volatile, so > only used for caching. > > Should we have some kind of this functionality too? > > E.g. for the new http cache backend we use andoid's cache dir and thus we > don't need any sophisticated eviction algorithm. It can make the code less > complex and takes some of the resposibility off an app coder.
IIRC, HTTP cache is stored in the /cache partition in B2G. The critical partition for B2G is /data, which is where apps, indexedDB, appcache, localStorage and cookies are stored. Deleting the content of /cache won't help during a low storage situation. > And in relation to "Low device storage (notifying the user)" thread - is > there a way an app can say its data is critical (e.g. sms, email when > removing mails from the server, contacts)? We could just delete the > non-critical apps data when needed. > AFAIK there is no way for apps to mark some data as critical. Maybe the DataStore API can take this into account. There is some data (in the /data partition) that might be considered as non-critical and so we might be tempted to remove it in case of an urgent need of disk space. I am thinking about appcache and cookies. Both can be certainly recovered again. However, downloading again an appcache content might cost to the user extra money, and cookies are not that big to be worth removing them. We could also think about temporarily moving this non-critical data to other location (i.e. the sdcard), but I am not sure if it is worth the effort to do this automatically. There were also some comments about the possibility of moving apps to the sdcard. So that's also another option. Cheers, / Fernando _______________________________________________ dev-b2g mailing list [email protected] https://lists.mozilla.org/listinfo/dev-b2g
