Skip to content
pubscout

flutter_cache_manager

3.5.0, released 2 weeks ago by baseflow.com

Generic cache manager for saving web files and cache info on device storage.

Rock solid
$ flutter pub add flutter_cache_manager
Source repository

What it does

Downloads and caches web files in the device's storage directory, utilizing HTTP Cache-Control headers for efficient retrieval. It tracks cache info using sqflite on supported platforms and JSON elsewhere, and supports automatic cleanup based on age and count.

AI-written summary of version 3.5.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to download files or images from the web and cache them locally.
  • You want automatic cache eviction based on file age and maximum item counts.

Skip it when

  • You only need local key-value persistence without downloading web files.
  • You require a complex relational database management system for local data.

Strengths

  • Efficient handling of Cache-Control headers and ETags.
  • Built-in support for image resizing via ImageCacheManager.
  • Customizable cache keys, file services, and storage systems.

Weaknesses

  • Creating multiple cache managers with the same key can cause conflicts.
  • Stale cache cleanups depend on background processes and OS-level storage clearing.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
9
var file = await DefaultCacheManager().getSingleFile(url);

Alternatives

Packages that do the same job and could replace flutter_cache_manager.

Works with

Packages commonly used together with flutter_cache_manager: ones it builds on, ones built on it, and its own family.