I am trying to display a list with a lot of (deleted) images. I am trying to use a volley to complete a task.
Volleyball works somewhat, but not good enough. ImageLoader.get volley has the following code snippet:
final String cacheKey = getCacheKey(requestUrl, maxWidth, maxHeight); // Try to look up the request in the cache of remote images. Bitmap cachedBitmap = mCache.getBitmap(cacheKey); if (cachedBitmap != null) { // Return the cached bitmap. ImageContainer container = new ImageContainer(cachedBitmap, requestUrl, null, null); imageListener.onResponse(container, true); return container; }
However, getCacheKey creates the following key:
private static String getCacheKey(String url, int maxWidth, int maxHeight) { return new StringBuilder(url.length() + 12).append("#W").append(maxWidth) .append("#H").append(maxHeight).append(url).toString(); }
i.e. It adds some βmetadataβ, such as width and height to the key.
This key never causes a hit, and if the image is not in the L1 cache, it is displayed on the Internet. When an image is downloaded online, it is stored in the diskβs cache, but volleyball saves it with a URL (and only a URL) as a key.
Is this the expected behavior? Did I miss something?
source share