meteor-slingshot/S3: How HTTP requests work between slingshot and S3

83 Views Asked by At

I'm a beginner developer trying to understand how some 'backend' processes work when uploading files from a web app.

I'm using edgee:slingshot in a meteor project to upload images to Amazon S3. My understanding is that a file upload from slingshot makes a POST request to S3 in order to upload a file to the bucket. I confirm this from the Chrome console where I can see the POST request (after a preflight OPTIONS request) to S3.

However the POST request count in S3 increased by 4 after uploading the image. I did not upload anything else, and there is only one other file in the bucket which is not being used anywhere.

Is this normal behaviour? I do not know the nuts and bolts of HTTP requests so this is all a bit mystifying. I am interested because S3 prices according to (amongst other things) the number of requests made.

Bonus question: The number of GET requests also increased (by 3, not 4) after uploading the image. Is this normal behaviour? The slingshot upload function returns the download URL of the image in the bucket. I did not think I was making any GET requests.

Is there some kind of behind-the-scenes validation/batch upload going on that is causing this?

Thanks for the help.

0

There are 0 best solutions below