ENH: avoid unnecessarily opening http connection