Custom Age Threshold On Cache Objects Over Capacity
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 48/100
調査の方向性
Config と getObjectsOverCapacity を見つけ、クリーンアップ中にハードコードされた 1 日の Duration がどこで使用されているかを追跡します。1 日のデフォルト値を維持したままオプションの Duration を追加し、12 時間などのカスタム値をサポートして、キャッシュのクリーンアップが引き続き設定されたしきい値を尊重することを確認します。
索引モデルが issue の本文から書いたものです。
説明
🏗 Enhancement Proposal
Allow configuring the age threshold used when cleaning up cache objects over capacity.
Pitch
Currently, getObjectsOverCapacity uses a hardcoded Duration(days: 1) to filter which cached objects are eligible for removal during cleanup. This means objects touched within the last 24 hours are never removed, even if the cache exceeds its capacity.
This can be problematic in scenarios where:
- Apps have high cache turnover and need more aggressive cleanup (e.g.,
Duration(hours: 6)) - Apps want to preserve recently accessed items for longer periods (e.g.,
Duration(days: 7)) - The 1-day threshold doesn't align with the app's usage patterns
Proposed solution:
Add an optional maxCapacityAgeFilterDuration parameter to Config that allows developers to customize this threshold. The parameter defaults to Duration(days: 1) to maintain backward compatibility.
CacheManager(
Config(
'customCacheKey',
maxCapacityAgeFilterDuration: Duration(hours: 12), // Only remove items untouched for 12+ hours
),
);
This gives developers fine-grained control over cache eviction behavior without changing the default experience.
Platforms affected (mark all that apply)
- 📱 iOS
- 🤖 Android
- 主要言語
- Dart
- スター
- 812
- フォーク
- 511
- 平均マージ
- 28分
- マージ済み PR(30日)
- 12
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Baseflow/flutter_cache_manager のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Baseflow/flutter_cache_manager#450 · コメント 9 件 · リアクション 8 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
Baseflow/flutter_cache_manager#535 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
Baseflow/flutter_cache_manager#508 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 30/100
Baseflow/flutter_cache_manager#501 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
Baseflow/flutter_cache_manager#500 · コメント 1 件 · リアクション 3 件 ·
メンテナーはふだん 1 日以内に返信
Baseflow/flutter_cache_manager の issue をすべて見る
似ている issue
-
Flutter Improvement Waiting for: Product Owner
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
getsentry/sentry-dart#4061 · コメント 2 件 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
rokwire/illinois-app#6060 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
openfoodfacts/smooth-app#7817 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
flutter/agent-plugins#245 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100