Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a file cache, specifying maximum size #32

Open
luigi-agosti opened this Issue · 7 comments

3 participants

@luigi-agosti

Just need to implement a new FileManager

@ataulm
Collaborator

A policy on what to do when the cache limit is hit should also be specifiable - do nothing, start deleting oldest, start deleting least recently accessed, etc.

@blundell
Owner

@ataulm nice idea, but the original issue is already implemented isn't it? We have a cache and you can request it's size but it defaults to something like 25% of the device memory

@ataulm
Collaborator

@blundell na, that's memory cache. There's a clean method in BasicFileManager but this deletes based on an expiration policy rather than when a size limit on disk is hit.

@ataulm
Collaborator

*expiration date

@blundell
Owner

so the file cache is never deleted? I thought this was handled by the Android system - because of the place we save the images to. yup yup

@ataulm
Collaborator

Not sure if Android does something special. If you use BasicFileManager it'll delete images which were older than one week (I suspect this is cached date rather than last accessed) by default. This relies on ImageLoader being initialised once per week.

The two points of control are in LoaderSettings: shouldCleanOnStartup (which is hardcoded as true...) and expiration period (default one week).

@blundell
Owner

Yeah, I was just pointing out this:
http://developer.android.com/guide/topics/data/data-storage.html#filesInternal

When the device is low on internal storage space, Android may delete these cache files to recover space. However, you should not rely on the system to clean up these files for you. You should always maintain the cache files yourself and stay within a reasonable limit of space consumed, such as 1MB. When the user uninstalls your application, these files are removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.