I always had the idea that the HEAD
request instead of the GET
request was faster (regardless of the size of the resource) and, therefore, had advantages in some solutions.
However, when creating a HEAD
request in Python (for a dynamically generated 5+ MB resource), I realized that it took the same time as the GET
request (I was hoping for almost 27 seconds instead of βless than 2β seconds).
Used some urllib2 solutions for the HEAD
request found here, and even used pycurl
(setting headers
and nobody
is True
). Both of them took the same time.
Am I losing something conceptually? Is it possible using Python to execute a "fast" HEAD
request?
source share