This way still seems to give you a weird broken-pipe error that I was seeing when looking up how to do this with the aws cli. I just tested your method vs s3head and s3head seems slightly faster for some reason, don't have the time right now to dive into why though...