Optimize http connection handling