继承GildeUrl类
在项目开发中遇到了一个问题:
图片是上传到阿里云上的,因为图片是私有的,图片地址后面会带有一些权限的认证,这样用一张图片地址会经常的变化,这样用gilde默认的缓存基本上失效。
public class
Engine
implements
EngineJobListener,
MemoryCache.ResourceRemovedListener,
EngineResource.ResourceListener {
public
<
T
,
Z
,
R
> LoadStatus load(Key signature,
int
width,
int
height, DataFetcher<
T
> fetcher,
DataLoadProvider<
T
,
Z
> loadProvider, Transformation<
Z
> transformation, ResourceTranscoder<
Z
,
R
> transcoder,
Priority priority,
boolean
isMemoryCacheable, DiskCacheStrategy diskCacheStrategy, ResourceCallback cb) {
Util.assertMainThread();
long
startTime = LogTime.getLogTime();
final
String id = fetcher.getId();
EngineKey key = keyFactory.buildKey(id, signature, width, height, loadProvider.getCacheDecoder(),
loadProvider.getSourceDecoder(), transformation, loadProvider.getEncoder(),
transcoder, loadProvider.getSourceEncoder());
...
}
...
}