title: Delete cache while using glide
body: <p>I know it is a very basic question. I have tried to find the numerous solution but I am not able to understand them. </p>
  
  <p><strong>What I want</strong></p>
  
  <p>upload image to the server and in return I am getting URL but the problem is while setting the image using this URL, the old image is set. This is happening because the glide is taking old cache and not updating the cache. </p>
  
  <p>How to solve this. </p>
  
  <pre><code>Glide.clear(profilePic);
  
  Glide.with(getApplicationContext())
      .load(url)
      .diskCacheStrategy(DiskCacheStrategy.ALL)
      .skipMemoryCache(true)
      .transform(new CircleTransform(MainProfile.this))
      .into(profilePic);
  </code></pre>
  
  <p>currently, the pic is changed but when I click the back button and come back to this activity then it loads an old image. Loading the image from cache like that.</p>
  
  <pre><code>//setting up the profile pic
  Glide.with(getApplicationContext())
  .load(userProfilePicUrl)
  .asBitmap()
  .centerCrop()
  .into(new BitmapImageViewTarget(profilePic) {
      @Override
      protected void setResource(Bitmap resource) {
          RoundedBitmapDrawable circularBitmapDrawable =
                                  RoundedBitmapDrawableFactory.create(MainProfile.this.getResources(), resource);
          circularBitmapDrawable.setCircular(true);
  
          profilePic.setImageDrawable(circularBitmapDrawable);
      }
  });
  </code></pre>
  
  <p>The problem is when I come back to this activity it shows old pic instead of new one. </p>