I am doing a little research and tests to get the status code from an Http response.
I need to get the response status code from a large list of sites using the fastest way, I can’t work in multiple threads, this will work in a batch process, and this is necessary.
I created a small test service that sends a request several times (avoiding the site cache) and retrieves time statistics.
I test different clients and APIs, but the response time is not good enough (min. 200 ms, average: 300-400 ms).
I am testing with Java URLConnection, SpringRestTemplate, ApacheHttpCommons, GoogleHttpClient and Restlet. One of the problems that I discovered is that in some of them I'cant only asks for HEAD and then retrieves the sode state, so I select the full answer.
I also think about sockets and scripts.
Any help would be appreciated a lot.
source
share