From a82d70b0baaa85c8ca234e39918d678e2b4bea76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sun, 25 Nov 2012 15:26:28 +0200 Subject: [PATCH] use "Connection: close" of file_get_contents otherwise php will do keepalive request, and wait timeout seconds before can return actual response. similar problem does not happen with curl backend --- min/lib/Minify/JS/ClosureCompiler.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/min/lib/Minify/JS/ClosureCompiler.php b/min/lib/Minify/JS/ClosureCompiler.php index fb474d11..51f7cd1a 100644 --- a/min/lib/Minify/JS/ClosureCompiler.php +++ b/min/lib/Minify/JS/ClosureCompiler.php @@ -69,7 +69,7 @@ public function min($js) } return $response; } - + protected $_fallbackFunc = null; protected function _getResponse($postBody) @@ -79,7 +79,7 @@ protected function _getResponse($postBody) $contents = file_get_contents(self::URL, false, stream_context_create(array( 'http' => array( 'method' => 'POST', - 'header' => 'Content-type: application/x-www-form-urlencoded', + 'header' => "Content-type: application/x-www-form-urlencoded\r\nConnection: close\r\n", 'content' => $postBody, 'max_redirects' => 0, 'timeout' => 15,