Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
open-source
MetaGer
Commits
5cc88ccb
Commit
5cc88ccb
authored
Sep 18, 2020
by
Dominik Hebeler
Browse files
split response print into parts
parent
3bedccc4
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
app/Http/Controllers/MetaGerSearch.php
View file @
5cc88ccb
...
...
@@ -143,7 +143,13 @@ class MetaGerSearch extends Controller
$counter
=
$registry
->
getOrRegisterCounter
(
'metager'
,
'query_counter'
,
'counts total number of search queries'
,
[]);
$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
)
...
...
app/Http/Middleware/BrowserVerification.php
View file @
5cc88ccb
...
...
@@ -16,6 +16,11 @@ class BrowserVerification
*/
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"
);
if
(
empty
(
$bvEnabled
)
||
!
$bvEnabled
)
{
return
$next
(
$request
);
...
...
@@ -37,11 +42,6 @@ class BrowserVerification
header
(
'Content-type: text/html; charset=utf-8'
);
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
));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment