-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
S3 reuse information from listObject and skip headObject #11518
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
Conversation
Signed-off-by: Daniel Kesselberg <[email protected]>
Signed-off-by: Daniel Kesselberg <[email protected]>
|
Code changes look good, but I would like to wait for the feedback of @icewind1991 here. |
icewind1991
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good otherwise
|
|
||
| $result = $this->headObject($path); | ||
| if (isset($result['ContentLength'])) { | ||
| return $result['ContentLength']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice if this would fill in the filesCache from the head response
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've been thinking about that but headObject has already some internal cache. I think this would just add additional complexity. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough
Signed-off-by: Daniel Kesselberg <[email protected]>
MorrisJobke
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code makes sense 👍
I've noticed when looking into #6954 that there are many unneccessary headObject requests.
According to https://docs.aws.amazon.com/AmazonS3/latest/API/v2-RESTBucketGET.html#v2-RESTBucketGET-responses-examples Size, LastModified and Etag returned with listObjects.
When calling
statfor a file the required information are size and last modified. Reusing this information from listObjects may save some api calls.