Baseflow / Baseflow/flutter_cache_manager

Add option to not use SQLite and default to that

Open
#454 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
809
Forks
510
Avg merge
6m
Merged PRs (30d)
1

Description

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.