Android 内存或磁盘中的备用缓存

Android Glide alternate cache in memory or disk

我在一个应用程序中工作,该应用程序确实包含经常使用的图像,但也有其他下载仅使用一次的图像。

Glide 是否有任何方法可以即时决定哪些图像应该只存储在磁盘中或只存储在内存中?

据我所知,缓存是否取决于配置购买我希望能够自己说出哪些应该在磁盘中,哪些不应该。

您可以使用 .diskCacheStrategy() to manually control whether and how an individual request is cached on disk and skipMemoryCache() 来控制是否将单个请求缓存在内存中。