Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Custom Age Threshold On Cache Objects Over Capacity

オープン
#507 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
48/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
dart, flutter
領域
mobile

調査の方向性

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Baseflow/flutter_cache_manager のほかの issue

Baseflow/flutter_cache_manager の issue をすべて見る

似ている issue

Dart の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。