Search code examples
amazon-web-servicesreact-nativeamazon-s3caching

AWS S3 bucket images - React Native app keeps showing old image


My app keeps showing my old image. I don't have bucket versioning. I tried restarting the app but it keeps showing this old image.. Is it caching somehow? Any tips on how to resolve?


Solution

  • The Image component of React-Native provides a cache extension for iOS for the source prop. Can you please try to set the cache to "reload"?

    <Image
      source={{
        uri: 'https://reactjs.org/logo-og.png',
        cache: 'reload'
        headers: {Pragma: 'no-cache'} // Android Support
      }}
      style={{ width: 400, height: 400 }}
    />
    

    Attention the support is only for iOS