flutter_advanced_networkimage icon indicating copy to clipboard operation
flutter_advanced_networkimage copied to clipboard

can use one cache for multi instance on multi pages?

Open develowper opened this issue 5 years ago • 5 comments

hello . i am using two networkimage in two page . image urls in two pages are the same. but every one cache image in its first time. means image caches two times in two directory (i think). can i use one cache for this two widget?

develowper avatar Jan 14 '20 11:01 develowper

https://github.com/mchome/flutter_advanced_networkimage/blob/6f2bd602fdef2e0235a380c7c192ebe36df25fba/lib/src/provider/flutter_advanced_networkimage.dart#L308-L318 If the equal expression is true, they will be treated as the same in memory cache. If the urls are the same, they will be treated as the same in disk cache.

mchome avatar Jan 14 '20 12:01 mchome

ok . thanks . and how i can check hashes are equal? how hashes are created? with file name or else?

develowper avatar Jan 14 '20 12:01 develowper

and can i cancel fetching url on dispose page? or is done automatically?

develowper avatar Jan 14 '20 12:01 develowper

ok . thanks . and how i can check hashes are equal? how hashes are created? with file name or else?

See the reference code above.

and can i cancel fetching url on dispose page? or is done automatically?

No, it will keep fetching until the response was received.

mchome avatar Jan 14 '20 13:01 mchome

No, it will keep fetching until the response was received.

unfortunately this slows down downloading images. a user may dispose image containing page and goes to another page with image. but last image is downloading and slows down network and performance. is not true?

develowper avatar Jan 14 '20 13:01 develowper