flexera-public / right_aws

RightScale Amazon Web Services Ruby Gems
MIT License
451 stars 175 forks source link

Bucket.get performs three HTTP calls #161

Open pieter opened 11 years ago

pieter commented 11 years ago

When I get an object ("/a") from a bucket, the following three HTTP calls are performed in order:

GET /a
GET /?prefix=a
HEAD /a

This is very expensive both computationally and monetary: the second request is a LIST, costing 10x as much as the GET.

From what I can see the trace is as follows:

S3::Bucket.get calls S3::Key.get
S3::Key.get performs refresh(false), which performs the GET /?prefix request
a bit lower in the refresh() meta information is requested

right_aws (3.0.4)

vagrant@precise64:/vagrant/tagcache$ ruby --version ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]