2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-04-29 14:06:47 +00:00

Improve API image fetcher

This commit is contained in:
Oliver Walters 2020-04-05 15:00:05 +10:00
parent e7bf236486
commit 06446998b2

View File

@ -304,10 +304,17 @@ class InvenTreeAPI {
imageUrl = staticImage; imageUrl = staticImage;
} }
return new AdvancedNetworkImage(makeUrl(imageUrl), String url = makeUrl(imageUrl);
return new AdvancedNetworkImage(url,
header: defaultHeaders(), header: defaultHeaders(),
useDiskCache: true, 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);
}
); );
} }
} }