Coil Image Loader:使用密钥缓存位图

Coil Image Loader : Cache Bitmap with a key

我正在使用 Coil 图片加载库。

我的问题:

我没有从后端获取图像 Url,而是获取 JPEG 编码字符串及其名称/密钥。

我想知道是否有任何内置缓存支持 bitmap 关于键,以便我可以避免在每次要显示该图像时都询问该编码字符串。

可能吗?如果不是,什么可能是解决我的问题的最佳方法?

提前致谢。

线圈依赖OkHttp's disk cache which controls its own cache key which is based off the URL. However it's possible to set the memory cache key using RequestBuilder.key.

如果您需要在获取数据后为数据设置缓存键,很遗憾,我认为目前没有针对该问题的内置解决方案。