Browser not refreshing image when image source URL is changed to URL of the image in the AWS S3 bucket
My react app allows the user to upload photos from their system and facebook (yet to be implemented). After uploading from the system, the URL of the displayed images are object URLs. Upon clicking Save, presigned URLs are requested from the server for each image. The presigned URLs are split to get only the URL portion (uptil .png or .jpg). Then the image source URLs are changed to the presigned URLs. The expectation is that the image refreshes by loading the image from the new image source. But it does not. However, if I right-click on select load image, the image loads. I tried things like cachebreaker, putting the image rendering code in a react component, using onError fallback, unique keys on images. Doesn’t work. Can anyone let me know a workaround. Code is as below.