Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Chromium bug for missing cross-origin requests #141

Closed
tridoan opened this issue Jun 11, 2020 · 1 comment
Closed

Fix Chromium bug for missing cross-origin requests #141

tridoan opened this issue Jun 11, 2020 · 1 comment
Labels

Comments

@tridoan
Copy link

tridoan commented Jun 11, 2020

Hi there,
I've discovered an issue when testing my environment, which uses AWS S3 for storage. I found that images were being requested twice in the console, and the results were that the images would not load on the front-end.

After some digging, i came across this thread, which explains the issue quite clearly.
https://serverfault.com/questions/856904/chrome-s3-cloudfront-no-access-control-allow-origin-header-on-initial-xhr-req/856948#856948

In the Accepted Answer, i was able to implement the Workaround #1, using Cloudfront and assigning a Custom Origin Headers value. This works, but i think this solution would be restrictive to some folks.

I recommend implementing the Alternative Hackaround #2 in the application itself.

Thanks

@ganigeorgiev
Copy link
Member

Hm, I couldn't reproduce it with the DigitalOcean S3 equivalent but even if the behavior is only AWS specific, I don't think that the second workaround is applicable in our case.

An image could be requested multiple times because it is displayed in multiple places and/or the application is loading the image in the background to check its width and height. So we heavily relies on the internal browser caching and by adding different query parameters to the requests will force the browser to download the image multiple times.

For now, I'll close the issue, but I'll make sure to link it in the the future S3 setup doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants