Baseflow / Baseflow/flutter_cache_manager

Add option to not use SQLite and default to that

Offen
#454 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Dart
Sterne
809
Forks
510
Ø Merge
6 Min.
Gemergte PRs (30 T.)
1

Beschreibung

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

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by tracing cache functions such as `getSingleFile` and the SQLite-backed cache path; the issue does not name specific files or tests. Determine which cache features require SQLite and how configuration is handled. Done means an option can disable SQLite, is enabled by default, and the file-cache behavior is covered by tests.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
dart, flutter
Bereich
mobile-dev
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.