Skip to content

[Discussions] When cache get removed from disk/storage ? #759

@dannndi

Description

@dannndi

Hi, I want to clarify how disk cache cleanup works in ExtendedImage.
From the documentation:
/// The max duration to cache image.
/// After this time the cache is expired and the image is reloaded.
Duration? cacheMaxAge;
My understanding was that when cacheMaxAge is reached, the previous
cached image on disk would be removed.

My speculation is

  • the image is re-downloaded when expired (due to app document keep growing in size)
  • but the old cache file stays in the temporary directory
  • this causes the cache size to grow continuously over time (hundreds of MB → 1GB+)

Questions:

  1. Is ExtendedImage expected to automatically delete old expired cache files?
  2. If not, what is the recommended approach for disk cleanup?
  3. Should developers run clearDiskCachedImages(duration: ...) manually on app startup or via a background job?

Thank you!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions