Baseflow / Baseflow/flutter_cache_manager

Respect must-revalidate cache-control header

Đang mở
#275 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
type: enhancement
Ngôn ngữ chính
Dart
Star
809
Fork
510
Merge trung bình
6 phút
Pull request đã merge (30 ngày)
1

Mô tả

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!

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Kiểm tra lib/src/cache_manager.dart quanh các dòng 83-86 và theo dõi cách các header bộ nhớ đệm của response ảnh hưởng đến các tệp đã được lưu trong bộ nhớ đệm nhưng hết hạn. Xác nhận cách xử lý dự kiến đối với max-age và must-revalidate, sau đó kiểm tra hành vi kết quả bằng các bài kiểm tra cache-manager liên quan.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
dart, flutter
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.