Baseflow / Baseflow/flutter_cache_manager

Respect must-revalidate cache-control header

オープン
#275 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
type: enhancement
主要言語
Dart
スター
809
フォーク
510
平均マージ
6分
マージ済み PR(30日)
1

説明

I've been using flutter_cache_manager within my application and, in general, it's been a life saver for me. So please allow me to start by thanking the team for working on this plugin!

That said, I've been troubleshooting some unexpected behavior in my application, and I think I've tracked it down to this line within getSingleFile():

https://github.com/Baseflow/flutter_cache_manager/blob/7ef4334c84bca6d4ab869e7bae7eddf6402a42f0/flutter_cache_manager/lib/src/cache_manager.dart#L86

If I'm reading this correctly, getSingleFile() will prefer to return a file from the cache _even if that file has expired_ per the test on line 83. Is that correct behavior? In my API server, I am returning `Cache-Control: max-age=900` with the expectation that user agents will never display content which has expired without re-fetching it first.

Is this a bug or is this expected behavior?

It doesn't look like flutter_cache_manager respects `must-revalidate` either, so do you have a recommendation on how I could accomplish the behavior I'm looking for?

Thanks again!

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

lib/src/cache_manager.dart の83〜86行付近を調査し、レスポンスのキャッシュヘッダーが期限切れのキャッシュ済みファイルにどのような影響を与えるかを追跡してください。max-age と must-revalidate の意図された処理を確認し、その結果の動作を関連する cache-manager のテストで検証してください。

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

評価

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

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

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