Glide not updating image android of same url?

Usman Saeed picture Usman Saeed · Jan 20, 2017 · Viewed 20.9k times · Source

I have the same url for an image. When I update this image more than one time it shows the previous image. The image and picture version on the server is updated but Glide is not showing the new image.I want to get new image every time and cache it .

Glide.with(context)
        .load(Constants.COPY_LINK_BASE_URL + info.getDisplayPicture())
        .placeholder(R.drawable.ic_profile).dontAnimate()
        .diskCacheStrategy(DiskCacheStrategy.SOURCE)
        .signature(new (SettingManager.getUserPictureVersion(context)))
        .into(ivUserProfilePhoto);

I can reproduce this bug by changing internet ,on one internet its change image as expected on other internet it remain same after 2 or 3 tries to changing image

Answer

jessica picture jessica · Feb 22, 2017
//Use bellow code, it work for me.Set skip Memory Cache to true. it will load the image every time.

 Glide.with(Activity.this)
.load(theImagePath)
.diskCacheStrategy(DiskCacheStrategy.NONE)
.skipMemoryCache(true)
.into(myImageViewPhoto);