I am working in Android app that load images from Amazon S3. The Image URL randomly changes with token and expiry key. For that reason i can't cache the image Glide.
There is any way to set Glide cache key as any static ID(like image id) not url.
I attached my code snippet to load image from AWS
Glide.with(remoteGalleryAct).load(photoFinalImageURL)
.signature(new StringSignature(getImageUrl(photoFinalImageURL)))// remove AWS keys
.error(defaultNoImageDrawable)
.placeholder(defaultNoImageDrawable)
.dontAnimate()
.diskCacheStrategy(DiskCacheStrategy.SOURCE)
.into(new ImageViewTarget<GlideDrawable>(photoHolder.photo) {
@Override
protected void setResource(GlideDrawable resource) {
}
@Override
public void onResourceReady(final GlideDrawable resource, GlideAnimation<? super GlideDrawable> glideAnimation) {
//super.onResourceReady(resource, glideAnimation);
view.setImageDrawable(resource);
}
});
Please suggest me there is any way to achieve in Glide.