Commit 5cc88ccb authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

split response print into parts

parent 3bedccc4
...@@ -143,7 +143,13 @@ class MetaGerSearch extends Controller ...@@ -143,7 +143,13 @@ class MetaGerSearch extends Controller
$counter = $registry->getOrRegisterCounter('metager', 'query_counter', 'counts total number of search queries', []); $counter = $registry->getOrRegisterCounter('metager', 'query_counter', 'counts total number of search queries', []);
$counter->inc(); $counter->inc();
return $resultpage; // Splitting the response return into multiple parts.
// This might speed up page view time for users with slow network
$responseArray = str_split($resultpage->render(), 1024);
foreach ($responseArray as $responsePart) {
echo ($responsePart);
flush();
}
} }
public function searchTimings(Request $request, MetaGer $metager) public function searchTimings(Request $request, MetaGer $metager)
......
...@@ -16,6 +16,11 @@ class BrowserVerification ...@@ -16,6 +16,11 @@ class BrowserVerification
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
ini_set('zlib.output_compression', 'Off');
ini_set('output_buffering', 'Off');
ini_set('output_handler', '');
ob_end_clean();
$bvEnabled = config("metager.metager.browserverification_enabled"); $bvEnabled = config("metager.metager.browserverification_enabled");
if (empty($bvEnabled) || !$bvEnabled) { if (empty($bvEnabled) || !$bvEnabled) {
return $next($request); return $next($request);
...@@ -37,11 +42,6 @@ class BrowserVerification ...@@ -37,11 +42,6 @@ class BrowserVerification
header('Content-type: text/html; charset=utf-8'); header('Content-type: text/html; charset=utf-8');
header('X-Accel-Buffering: no'); header('X-Accel-Buffering: no');
ini_set('zlib.output_compression', 'Off');
ini_set('output_buffering', 'Off');
ini_set('output_handler', '');
ob_end_clean();
$key = md5($request->ip() . microtime(true)); $key = md5($request->ip() . microtime(true));
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment