Baseflow / Baseflow/flutter_cache_manager

Add option to not use SQLite and default to that

未关闭
#454 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Dart
星标
809
派生
510
平均合并
6 分钟
30 天内合并 PR
1

描述

## 🚀 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

贡献指南

打开贡献指南

调研方向

首先跟踪 `getSingleFile` 等缓存函数以及基于 SQLite 的缓存路径;该 issue 未指定具体的文件或测试。确定哪些缓存功能需要 SQLite,以及配置是如何处理的。完成的标准是:提供一个可禁用 SQLite 的选项,该选项默认启用,并且文件缓存行为有测试覆盖。

由索引模型根据 Issue 内容生成。

评估

技术栈
dart, flutter
领域
mobile-dev
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。