mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-28 05:26:47 +00:00
Improve API image fetcher
This commit is contained in:
parent
e7bf236486
commit
06446998b2
11
lib/api.dart
11
lib/api.dart
@ -304,10 +304,17 @@ class InvenTreeAPI {
|
||||
imageUrl = staticImage;
|
||||
}
|
||||
|
||||
return new AdvancedNetworkImage(makeUrl(imageUrl),
|
||||
String url = makeUrl(imageUrl);
|
||||
|
||||
return new AdvancedNetworkImage(url,
|
||||
header: defaultHeaders(),
|
||||
useDiskCache: true,
|
||||
cacheRule: CacheRule(maxAge: const Duration(days: 5)),
|
||||
//retryDuration: const Duration(seconds: 2),
|
||||
//retryLimit: 3,
|
||||
cacheRule: CacheRule(maxAge: const Duration(days: 1)),
|
||||
loadFailedCallback: () {
|
||||
DiskCache().evict(url);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user