Skip to content
pubscout

http_cache_mmkv_store

2.0.0, released 2 months ago by bam.tech

MMKV-based cache store for Dio HTTP requests

$ flutter pub add http_cache_mmkv_store
Source repository

What it does

Provides a fast, persistent cache store for Dio HTTP requests using MMKV. It supports optional encryption, custom storage spaces, and dependency injection for testing.

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

Use it when

  • You need a quick, persistent cache for Dio HTTP responses
  • You want optional encryption for cached data
  • You need to customize storage directories or instance identifiers

Skip it when

  • You are not using Dio or need a different HTTP client
  • You require a database or SQL-based cache
  • You need a cross-platform cache that works without native MMKV

Strengths

  • Fast storage via MMKV
  • Optional encryption
  • Customizable storage spaces
  • Testable with injected MMKV instance

Weaknesses

  • Tied to Dio HTTP client
  • Requires native MMKV initialization
  • Only supports MMKV, not other storage backends

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
3

Initialize MMKV before use: await MMKV.initialize() or await MMKVCacheStore.initialise(); no build_runner needed

import 'package:http_cache_mmkv_store/http_cache_mmkv_store.dart';
import 'package:dio/dio.dart';
import 'package:dio_cache_interceptor/dio_cache_interceptor.dart';

Future<void> setupDio() async {
  await MMKVCacheStore.initialise();
  final cacheStore = MMKVCacheStore();
  final cacheOptions = CacheOptions(store: cacheStore, policy: CachePolicy.request);
  final dio = Dio()..interceptors.add(DioCacheInterceptor(options: cacheOptions));
}

Alternatives

Packages that do the same job and could replace http_cache_mmkv_store.

  • cross_cache

    Cross-platform caching library for Flutter using IndexedDB and the file system.

  • king_cache

    File‑ and IndexedDB‑based cache for API responses and markdown content.

  • hive_local_storage

    A wrapper around hive_ce for easy local data storage and encryption.

  • ffcache

    File-based key-value store with automatic cache expiration in temporary folders.

Works with

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