1
0
mirror of https://github.com/mrclay/minify.git synced 2025-08-08 15:16:56 +02:00

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
This commit is contained in:
Elan Ruusamäe
2012-11-25 15:26:28 +02:00
parent 7e08cff1f0
commit a82d70b0ba

View File

@@ -69,7 +69,7 @@ class Minify_JS_ClosureCompiler {
}
return $response;
}
protected $_fallbackFunc = null;
protected function _getResponse($postBody)
@@ -79,7 +79,7 @@ class Minify_JS_ClosureCompiler {
$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,