Open natario1 opened 7 years ago
Suggestions:
cacheDir
cacheDir
filesDir
filesDir
cacheDir
and leave the others where they are. If I got this correctly this means that when the user clears app cache, currentUser
, currentInstallation
, installationId
, currentConfig
and applicationId
are kept. The rest is cleared.
What do you think?
The final structure would be as follows:
filesDir
cacheDir (clearable by android and by end user)
CommandCache
, that is, saveEventually operations waiting for network connection (changed)ParseFile
cache (unchanged)PushRouter
(changed)LocalIdManager
stuff (changed)Hi, do not intend to hijack this thread. But I think my question is very much related. I want to keep files locally, for a long duration of time. Also, I wish to keep a lot of other object in the local data store using *.pinInBackground() or similar.
So my question is : where will all the 'pinned' objects get saved ? and can I change something in config so that parse saves the downloaded Files (using ParseFile.getFile()) in a different dir ? also, is 'pinning' good for heavy data lifting ?
PS : please do tell if you think this should actually be a different thread.
I’d like to address #98 , but before doing that, I’d like to discuss file/cache storage as it currently is. Most of all I would like to get rid of the deprecated
Parse.getParseDir()
which is still used here and there. There are:Parse.getParseDir()
annotated as deprecated, and I agreeParse.getParseCacheDir()
Parse.getParseFilesDir()
Here’s where we use them:
getParseDir() + "/LocalId"
: used by LocalIdManagergetParseDir() + "/CommandCache"
: used byParseCommandCache
getParseDir() + "/currentUser"
: used byParseCorePlugins
getParseDir() + "/currentConfig"
: used byParseCorePlugins
getParseDir() + "/currentInstallation"
: used byParseCorePlugins
getParseDir() + "/installationId"
: used byParsePlugins
getParseCacheDir() + "/applicationId"
: used byParse
getParseCacheDir() + "/GCMRegistrar"
: used byGcmRegistrar
getParseCacheDir() + "/files"
: used by ParseFileController forParseFile
temporary and cache filesgetParseFilesDir() + "/push"
: used byPushRouter
So we should move all
getParseDir()
(deprecated) to eithergetParseCacheDir()
orgetParseFilesDir()
. But looking at this, I see no pattern. What should go tocacheDir
, and what tofilesDir
?I know the implementation won't be easy to avoid breaking current caches, so we will have to support legacy dirs for a while etc. But here I would just like to understand the intended usage of
cacheDir
andfilesDir
. We actually store no files, these are all just caches of something. EvenParseFile
are stored incacheDir/files
...In short We need a new home for LocalId, CommandCache, currentUser, currentConfig, currentInstallation and installationId. Should it be
cacheDir
orfilesDir
? And actually, couldn't we usecacheDir
for everything?