mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Improve API image fetcher
This commit is contained in:
parent
e7bf236486
commit
06446998b2
1 changed files with 9 additions and 2 deletions
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…
Add table
Add a link
Reference in a new issue