You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we fetching image like that which works pretty fine, with the exception of 404 response.
Then the image is requested again and again.
Don't know why they are not cached (status code or empty response?).
Headers should be correct (The images never change (when content change, the uri will change, so we set the immutable header).
CircleAvatar(
foregroundImage: userImage(_partner!),
backgroundImage: defaultImage(_partner!))
userImage(User partner) => (partner.pictureUrlDisplay != null)
// there is no configuration, image caching depends on cache control header send by the server
? CachedNetworkImageProvider(
partner.pictureUrlDisplay!,
headers: userImageHeaders,
errorListener: (err) {
_logger.w("failed to load image: $err");
},
)
: defaultImage(partner);
defaultImage(User partner) =>
AssetImage((partner.gender == "man") ? "assets/image_not_found_man.webp" : "assets/image_not_found_woman.webp");
Describe the feature
allow caching of 404 image requests depending on cache headers.
Server already returns suitable header Cache-Control: immutable, max-age=86400
If needed add config similar to CacheOptions in DioCacheInterceptor hitCacheOnErrorExcept: [403, 503, 521], // do not cache temporary errors
The text was updated successfully, but these errors were encountered:
why the the CachedNetworkImage widget throws an error , when the given URL is invalid , even error handler exists , this causes a test failed in widget testing
🚀 Feature Requests
we fetching image like that which works pretty fine, with the exception of 404 response.
Then the image is requested again and again.
Don't know why they are not cached (status code or empty response?).
Headers should be correct (The images never change (when content change, the uri will change, so we set the immutable header).
Describe the feature
allow caching of 404 image requests depending on cache headers.
Server already returns suitable header
Cache-Control: immutable, max-age=86400
If needed add config similar to CacheOptions in DioCacheInterceptor
hitCacheOnErrorExcept: [403, 503, 521], // do not cache temporary errors
The text was updated successfully, but these errors were encountered: