Optimize flush for the HTTP client