Baseflow / Baseflow/flutter_cache_manager

Add option to not use SQLite and default to that

Đang mở
#454 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
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ả

## 🚀 Feature Requests

### Contextualize the feature
? Not even sure what the question means.

### Describe the feature
I was profiling a long task that opens a couple thousand small cache files.
In this profile i was surprised to see calls going back to SQLite take up ~10% of all the time. Why?
Why is SQLite in the cache path at all??

I frankly don't even care much about the "why" part here. The cache is a `key` -> `file content as value` type store with an URL as additional option (dependent on which API function you call) which downloads the file that needs to be cached if it's not cached yet.

When you call a cache function (like `getSingleFile`) then you already provide the URL the cache needs to download. It should do all other logic without SQLite, right? For example, it can `hash` the url and use that as key. It can store a file by that hash in the temporary app file store and call it done. Getting the cached data is as simple as doing the `hash` of the url again, testing if the file with that hash exists and return it's content if it does.

I'm hoping for an option in the config to disable SQLite completely and enable that option by default. Granted, this is from a very narrow point of view with just a file being cached and retrieving it. Perhaps there are other features that do require a database?

### Platforms affected (mark all that apply)
Irrelevant, platform agnostic.
- [ ] :iphone: iOS
- [ ] :robot: Android

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

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

Hướng nghiên cứu

Bắt đầu bằng cách lần theo các hàm cache như `getSingleFile` và đường dẫn cache dựa trên SQLite; issue không nêu tên các tệp hoặc bài kiểm thử cụ thể. Xác định những tính năng cache nào yêu cầu SQLite và cấu hình được xử lý như thế nào. Được coi là hoàn tất khi có một tùy chọn có thể tắt SQLite, tùy chọn này được bật theo mặc định và hành vi của file-cache được bao phủ bởi các bài kiểm thử.

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-dev
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
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
25/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.