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

Make treshold the 1 day treshold for maxObjects configurable

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

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

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

評価

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

調査の方向性

CacheObjectProvider.getObjectsOverCapacity から始めて、現在 Config オブジェクトが maxObjects と stalePeriod を provider に渡している方法を追跡します。1 日をデフォルトとするオプションの Duration 設定を追加し、provider 経由で渡し、関連する設定オプションと併せてドキュメント化し、キャッシュが設定された保持しきい値を尊重することを確認します。

索引モデルが issue の本文から書いたものです。

説明

🏗 Enhancement Proposal

When setting maxNrOfCacheObjects to 100 the cache can still grow above that size. This is caused by logic in the CacheObjectProvider in the getObjectsOverCapacity function.

where: '${CacheObject.columnTouched} < ?',
whereArgs: [
        DateTime.now().subtract(const Duration(days: 1)).millisecondsSinceEpoch
      ],

From an this issue #349 I understand the reasoning behind this default value.

Pitch

For app which are not used very intense I think the default makes sense. However for apps which use a lot of images and are used intensively throughout the day this results in a very big local cache. I've got reports of several GB.

I would argue that the there should be a parameter to override this in the Config object. This would be in line with for example the maxObjects and stalePeriod parameters.

Concretely:

  • Add parameter to Config ObjectMinimumRetention (open for better naming)
  • Type Duration
  • Optional, default value 1 day
  • Pass and use this parameter to the CacheObjectProvider
  • Document

I'm happy to do a PR on this as you think this makes sense.

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 を短くまとめたダイジェスト。