Baseflow / Baseflow/flutter_cache_manager

Respect must-revalidate cache-control header

Ouverte
#275 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
type: enhancement
Langage dominant
Dart
Étoiles
809
Forks
510
Merge moyen
6 min
PR mergées (30 j)
1

Description

I've been using flutter_cache_manager within my application and, in general, it's been a life saver for me. So please allow me to start by thanking the team for working on this plugin!

That said, I've been troubleshooting some unexpected behavior in my application, and I think I've tracked it down to this line within getSingleFile():

https://github.com/Baseflow/flutter_cache_manager/blob/7ef4334c84bca6d4ab869e7bae7eddf6402a42f0/flutter_cache_manager/lib/src/cache_manager.dart#L86

If I'm reading this correctly, getSingleFile() will prefer to return a file from the cache _even if that file has expired_ per the test on line 83. Is that correct behavior? In my API server, I am returning `Cache-Control: max-age=900` with the expectation that user agents will never display content which has expired without re-fetching it first.

Is this a bug or is this expected behavior?

It doesn't look like flutter_cache_manager respects `must-revalidate` either, so do you have a recommendation on how I could accomplish the behavior I'm looking for?

Thanks again!

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

Examinez lib/src/cache_manager.dart autour des lignes 83-86 et suivez l’impact des en-têtes de cache des réponses sur les fichiers mis en cache arrivés à expiration. Confirmez le traitement prévu de max-age et must-revalidate, puis vérifiez le comportement obtenu avec les tests pertinents de cache-manager.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
dart, flutter
Domaine
mobile
Type d'issue
Bug
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.