Skip to content

Add Cache Storage Size Limit #58

@natty-pluz

Description

@natty-pluz

Feature Request:
Please add a configurable cache storage size limit. This feature would allow to set a maximum cache size, preventing excessive storage usage.

Use Case:
In apps displaying many images, the cache can grow too large, consuming too much storage. A size limit would help manage storage more effectively.

Proposed Implementation:

  • Add a parameter for maximum cache size (in bytes) to the configuration:
  await FastCachedImageConfig.init(
    subDir: storageLocation,
    clearCacheAfter: const Duration(days: 7),
    maxCacheSize: 100 * 1024 * 1024, // Example: 100 MB
  );
  • Implement logic to remove the least recently used items when the cache exceeds this limit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions