api_cache_plugin 0.0.1 copy "api_cache_plugin: ^0.0.1" to clipboard
api_cache_plugin: ^0.0.1 copied to clipboard

A Flutter plugin for caching API responses using Hive and GZip compression with configurable timeouts.

API Cache Plugin #

A Flutter plugin for caching API responses using Hive storage with GZip compression.
Configurable cache timeout (default: 3 minutes).

Features #

  • Hive persistent storage.
  • GZip compression for efficient storage.
  • Configurable cache timeout.
  • Works with any HTTP library (http, Dio, Chopper, etc.).

Usage #

final cache = CacheManager();
const url = "https://api.example.com/data";

final cached = await cache.getCached(url);
if (cached != null) {
  print("From Cache: $cached");
} else {
  final response = await http.get(Uri.parse(url));
  await cache.saveCache(url, response.body);
}
1
likes
130
points
57
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A Flutter plugin for caching API responses using Hive and GZip compression with configurable timeouts.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

archive, flutter, hive, hive_flutter, path_provider

More

Packages that depend on api_cache_plugin