question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Image] Cache never expires for the same uri

See original GitHub issue

Even the image from the same uri is changed, <Image> still returns cached data. The code is here: Libraries/Image/RCTImageDownloader.m#L91

There should be a parameter that makes <Image> simply return a fresh copy of the image.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:38 (16 by maintainers)

github_iconTop GitHub Comments

23reactions
JohnyDayscommented, May 25, 2015

If you need a quick fix you can add

var url = 'weather.gc.ca/data/satellite/goes_nam_1070x_100.jpg'
url += '?random_number=' new Date().getTime()

This will however always download the image.

14reactions
idecommented, May 26, 2015

@umhan35 there might be a bug in the image component, but for a temporary workaround (emphasis on temporary! if there is a bug in react we should fix it), you could specify <Image key={url} /> which will replace your old image with a new one each time the URL changes.

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-native Image Cache never expires for the same uri
react-native Image Cache never expires for the same uri. Even the image from the same uri is changed, and if the uri do...
Read more >
Guide for Caching and HTTP Cache Headers for Static Content
1. Change the fingerprint in the resource URL · 2. Wait till resource expires in the local cache · 3. Use Service Workers...
Read more >
Django's cache framework
You can set TIMEOUT to None so that, by default, cache keys never expire. A value of 0 causes keys to immediately expire...
Read more >
Remove Outdated Content tool - Search Console Help
Use the Remove Outdated Content tool to have Google update search results for pages or images that no longer exist, or pages that...
Read more >
Origin Cache Control - Cloudflare Docs
Caching static resources at Cloudflare reduces your server load and ... into four groups: cacheability, expiration, revalidation, and other.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found