TechBuzzPro

Glide Not Updating Image on Android: Fix Same URL Cache

· 6 min read · Phones & Tablets

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

Glide is showing the old picture because it caches images by URL, and the URL has not changed. When the image behind the same link is replaced on the server, Glide has no reason to re-download it: it already has a bitmap stored for that key. The fix is to force a new cache key or to tell Glide to skip the cache. The quickest working option is to call .signature() with something that changes when the image changes, or to add a version query string to the URL. If you cannot change the URL or add a signature, use .diskCacheStrategy(DiskCacheStrategy.NONE) together with .skipMemoryCache(true), but only for that specific request, since it costs bandwidth and load time.

What You'll Need

  • An Android project using Glide (the official library from the Google Maven repository, not a modified build).
  • A way to know when the image actually changed: a timestamp, a version number, an ETag, or a field from your API response.
  • Access to the code that builds the Glide request, usually a single helper or adapter.
  • Optional: a server you control, if you prefer to send proper cache headers instead of changing the client.

Step-by-Step

  1. Confirm the URL really is identical. Log the string you pass to Glide.with(context).load(url). If the server returns a slightly different URL (a different CDN host, an extra query parameter, a signed link that expires), Glide already treats it as a new image and the problem is elsewhere. Only continue if the string is byte-for-byte the same.
  2. Decide what counts as "changed". A reliable signal is a value that moves whenever the file changes: the file's last-modified time in milliseconds, a hash of the file, an updated-at timestamp from your API, or an ETag header. If your API does not expose one, ask for it; guessing is what causes this bug in the first place.
  3. Add a signature to the request. This is the cleanest fix because it keeps caching for everything else while invalidating this one entry:
    Glide.with(context)
        .load(url)
        .signature(ObjectKey(updatedAtMillis))
        .into(imageView)
    The signature becomes part of the cache key, so a new timestamp produces a new memory and disk entry. Old entries are evicted by Glide's normal cache limits.
  4. Or append a version query string. If you control the URL, url + "?v=" + updatedAtMillis works the same way and is easy to reason about. Make sure your server ignores unknown query parameters, and be aware that this creates a new file on disk each time, so keep the version value coarse (per update, not per request) to avoid filling the cache.
  5. Use the no-cache combination as a last resort. When you genuinely cannot produce a changing value, disable both caches for that request only:
    Glide.with(context)
        .load(url)
        .diskCacheStrategy(DiskCacheStrategy.NONE)
        .skipMemoryCache(true)
        .into(imageView)
    Every load now hits the network. Do not apply this globally in an app that shows many images.
  6. Check the server side too. If the response carries a long Cache-Control: max-age or an Expires header far in the future, the HTTP layer may serve the stale file before Glide even looks at its own cache. Setting a short max-age, or sending Cache-Control: no-cache with a validator such as an ETag, lets clients revalidate cheaply.
  7. Rebuild and test with a real change. Replace the image on the server, bump the timestamp or version your app reads, then reopen the screen. To verify the cache is behaving, watch the network inspector: with a signature, you should see exactly one new download after the version changes, and none when it does not.
  8. Clear stale entries once during development. If you were testing before the fix, old bitmaps may still sit in the disk cache. Clearing app storage (Settings > Apps > your app > Storage > Clear storage) removes them. This deletes the app's local data, including logins and preferences, so only do it on a test device or accept the reset.

Common Mistakes

  • Calling .signature() with a constant. A fixed string produces a fixed cache key, which changes nothing. The value must differ when the image differs.
  • Using the current time as the signature. System.currentTimeMillis() at request time makes every load unique, so the cache never helps and the image flickers on every bind.
  • Disabling the disk cache but leaving the memory cache on. The stale bitmap can still be served from memory, so the image appears not to update until the process restarts.
  • Forgetting .thumbnail() and placeholder requests. If you load a thumbnail or placeholder from the same URL, it needs the same signature, or it will keep showing the old version.
  • Changing the URL in one place only. A list adapter, a detail screen and a notification may each build their own request. Put the URL and signature logic in one helper so they cannot drift apart.
  • Assuming the image view is the problem. If the request never reaches Glide (for example, the adapter is not rebound), no cache setting will help. Log inside the binding code.

Tips

  • Prefer a server-provided version value over a client-side timestamp; it survives reinstalls and multiple devices.
  • Keep signatures stable across app restarts. A value derived from the file's modified time is stable; a random UUID is not.
  • Use DiskCacheStrategy.AUTOMATIC for normal images and reserve NONE for the rare case where freshness matters more than speed.
  • If the image is small and changes often (an avatar, a status icon), a short server max-age plus a signature is usually cheaper than disabling caching.
  • Test with airplane mode after a successful load: a correctly cached image should still appear, which proves your cache settings are doing what you think.

Troubleshooting

The image still looks old after adding a signature. Check that the signature value actually changed in the running app. Log it next to the URL. If it is the same, the data source is stale, not Glide.

It updates on a fresh install but not after an update. The disk cache survived and still holds the old entry under the old key. Confirm the new key differs, then clear app storage once on a test device.

Only some screens update. Those screens are probably building requests without the signature. Centralise the request builder.

The image reloads every time the list scrolls. Your signature is changing per bind. Derive it from the image's version, not from the current time or a random value.

Nothing downloads at all. The URL may be failing, or a network security configuration may be blocking it. Check the response in a browser or an HTTP inspector before blaming the cache.

You cannot change the client code. Then fix it on the server: return a new URL, or send Cache-Control: no-cache with an ETag so clients revalidate. Note that some HTTP clients still honour a long max-age, so shortening it is the reliable move.

Frequently Asked Questions

Why does Glide cache by URL?

Because the URL is the cheapest stable identifier available. Hashing the image contents would require downloading it first, which defeats the purpose of the cache.

Does changing the file on the server update the app automatically?

No. Glide has no way to know the bytes behind a URL changed. Something in the request key or the HTTP headers must change.

Is .signature() better than a query string?

Both work. A signature keeps the URL clean and is easy to apply in one place; a query string is visible in logs and easier to debug across tools.

Will disabling the disk cache fix it permanently?

It hides the problem and costs bandwidth on every load. Use it only where freshness genuinely beats performance.

Does clearing the app cache remove user data?

Clearing cache does not; clearing storage does. On Android, Settings > Apps > your app separates the two, though labels vary by version and manufacturer.

Can I invalidate one cached image without touching the rest?

Yes, by changing that request's key (signature or URL). Glide evicts old entries through its normal size limits rather than on command.