Baseflow / Baseflow/flutter_cache_manager

Add option to not use SQLite and default to that

Abierto
#454 3 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Dart
Estrellas
809
Forks
510
Merge medio
6 min
PR fusionados (30 d)
1

Descripción

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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
dart, flutter
Área
mobile-dev
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.