I was trying to call the url from angular using $http.get(s3-amazon-bucket-url).
We tried the following
- Clear the cache. It worked, but once the image was recached, it wouldn't work.
- Clear the cache. For whatever reason, the customer's cache wouldn't clear.
- Go to developer settings, click on Network, and check Disable cache. This worked while the developer window was open, but not once it was closed.
- Tried Ctrl-F5 to do a hard refresh
None of these worked. Sometimes the change would be temporary, other times not.
Finally, we tried appending a random string on the end of the get url. so it looked like : https://s3-us-west-1.amazonaws.com/efinaldate-images/prod/orders/1/1/eFinalDate-230-sized-21e6088c.jpg?2093930290393 (tied to miliseconds).
This actually worked.
We did a big no-no, and pushed this one line change on the server in the middle of the day 😁
var url = order.processed_url + '?' + Date.now();
And, well, it worked. This is a total hack, and recognizes that the cache is based on the url, but the file is only based on the first part of the url. The url is now different, so it asks the server for the latest version of the file.