Skip to content
New issue

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

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

Already on GitHub? # to your account

Remove potentially redundant HEAD request #2140

Merged

Conversation

eritiro
Copy link
Contributor

@eritiro eritiro commented Mar 14, 2017

When you check if a file exists using Fog, you can potentially end up with an extra HEAD request to the remote server: one request to check its existence and another to read the file.

Consider the following code:

if fog_file.exists?
  fog_file.read
end

It will produce two HEAD request and one GET
With this PR, it will produce only one HEAD and one GET.

@mshibuya mshibuya merged commit 72f123a into carrierwaveuploader:master Sep 30, 2017
@mshibuya
Copy link
Member

Agreed, thanks.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants