We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
请问如何在不清除缓存的情况下,强制直接从网络加载图片呢
The text was updated successfully, but these errors were encountered:
@huli1987 仅某个情况用时,你可以只清除指定url的缓存:
final ImageRequest request = ImageRequest.fromUri(Uri.parse("url")); CacheKey cacheKey = DefaultCacheKeyFactory.getInstance().getEncodedCacheKey(request); StagingArea.getInstance().remove(cacheKey); Fresco.getImagePipelineFactory().getMainDiskStorageCache().remove(cacheKey);
你一定要达到这种目的的话,可以在ImageRequest设置最低缓存层级,禁止这次的请求获取缓存内容,但是它至少会检查内存缓存。
ImageRequest
ImageRequest request = ImageRequestBuilder.newBuilderWithSource(Uri.parse("url")) .setLowestPermittedRequestLevel(ImageRequest.RequestLevel.BITMAP_MEMORY_CACHE) .build();
如果一定要全局这么搞,你可以在初始化的时候设置CacheKeyFactory给ImagePipelineConfig,让它每次返回不同的缓存key,就能达到你的目的了
Sorry, something went wrong.
No branches or pull requests
请问如何在不清除缓存的情况下,强制直接从网络加载图片呢
The text was updated successfully, but these errors were encountered: