Closed andrewmunn closed 6 years ago
What request are you using to load the image after you expect it to be cached? In particular, what DiskCacheStrategy
are you using?
After I cache the image, I'm using the default disk cache strategy. Usually a very simple request like
requestManager.load(localUri).into(myImageView)
Thanks, I'm not able to reproduce this if I make sure the cache keys are the same. Two quick points:
.submit()
or .into()
when you use .download()
. There's now an IDE error that will show if you don't use the result of .download()
, but it's an easy mistake to make. I got bit by 2. above when looking in to this. I'd suspect your issue is the first one though from the line you pasted in your original question (sorry I didn't notice it earlier).
This issue has been automatically marked as stale because it has not had activity in the last seven days. It will be closed if no further activity occurs within the next seven days. Thank you for your contributions.
Glide Version: 4.1.1
Integration libraries: Okhttp3
Device/Android Version: Pixel XL 8.0.0
Issue details / Repro steps / Use case background: I want to cache local photos the user takes with the in-app camera at original resolution in the Glide disk cache, because after I upload the images to the server, I delete the local copy. By preloading the image into Glide, it ensures it will be available without re-fetching from the CDN after upload.
However,
requestManager.download(localImageUri);
doesn't seem to do the trick. After I delete the local image, Glide can no longer display that Uri and reports:
This appears to be a bug. The
download
method usesDiskCacheStrategy.DATA
, which should copy all request data into the disk cache, regardless if theDataSource
isLOCAL
or not.Am I doing it wrong? bug? Or intended behavior?
Thanks, and thanks for an awesome library!