How can I control network caching from my Flutter app?

For example, https://docs.flutter.io/flutter/services/NetworkImage-class.html says that cache headers are ignored. My understanding is that iOS has NSUrlCache on disk, and it would be nice to be able to enable this. Similarly, I suspect that Android has a disk cache that would be nice to include.

Can I control Flutter caching? Should I write my own disk caching / caching strategy in Dart on top of / before NetworkImage?

+4
source share
1 answer

We currently have no good way to do this, unfortunately. You could provide your own ImageProvider, similar to NetworkImageProvider, which had its own cache and correctly implemented network semantics. Of course, we will take it as a patch if you have contributed. :-)

+1
source

Source: https://habr.com/ru/post/1675853/


All Articles