def http_client
      @http_client ||= begin
        # timeout setting on http.rb seems to be a mess.
        # https://github.com/httprb/http/issues/488
        client = HTTP.timeout(:global, write: timeout / 3, connect: timeout / 3, read: timeout / 3)

        if settings["oai_pmh.try_gzip"]
          client = client.use(:auto_inflate).headers("accept-encoding" => "gzip;q=1.0, identity;q=0.5")
        end

        if settings["oai_pmh.http_persistent"]
          parsed_uri = URI.parse(start_url)
          client = client.persistent("#{parsed_uri.scheme}://#{parsed_uri.host}")
        end

        client
      end
    end
def http_client
      @http_client ||= begin
        # timeout setting on http.rb seems to be a mess.
        # https://github.com/httprb/http/issues/488
        client = HTTP.timeout(:global, write: timeout / 3, connect: timeout / 3, read: timeout / 3)

        if settings["oai_pmh.try_gzip"]
          client = client.use(:auto_inflate).headers("accept-encoding" => "gzip;q=1.0, identity;q=0.5")
        end

        if settings["oai_pmh.http_persistent"]
          parsed_uri = URI.parse(start_url)
          client = client.persistent("#{parsed_uri.scheme}://#{parsed_uri.host}")
        end

        client
      end
    end
re-use an http-client for subsequent requests, to get http.rb's persistent connection re-use
 Note this means this is NOT thread safe, which is fine for now, but we'd have to do something
 different if we tried to multi-thread reading multiple files or something.

 @returns [HTTP::Client] from http.rb gem