Fastest Net::HTTP/Net::HTTPS wrapper for Ruby

230 Views Asked by At

What is the fastest way to download a webpage for parsing in Ruby? I've tried using open-uri and HTTParty both seem to take roughly about 25 seconds to download simple webpages (I've tried multiple sites).

I'm passing the sites to Nokogiri but the latency takes place prior to passing any parameters to Nokogiri.

1

There are 1 best solutions below

0
sig On BEST ANSWER

i prefer to use gem 'http' (https://github.com/httprb/http). It is fast, clean api.

Also you can take a look on the http clients comparison table: https://github.com/httprb/http#another-ruby-http-library-why-should-i-care