From ea0c142784dedbbc3e93b84bea865a40ccb6dc94 Mon Sep 17 00:00:00 2001 From: Christoph Dwertmann Date: Thu, 5 Feb 2015 15:37:31 +1100 Subject: Add ob_flush() to sendGIF I'm running this dokuwiki docker container: https://registry.hub.docker.com/u/mprasil/dokuwiki/ It uses lighttpd and fastcgi. For some reason, the ignore_user_abort() feature where the browser should close the connection after the GIF has been received is not working on lighty. The browser keeps loading the page until the indexer run is complete, which leads to extremely slow load times with a larger page index. Adding ob_flush() to sendGIF fixes the issue. --- lib/exe/indexer.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/exe') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 330b8498d..2de178caa 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -199,6 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; + ob_flush(); flush(); // Browser should drop connection after this // Thinks it's got the whole image -- cgit v1.2.3 From e13bd5dcd000cc82ed5f1379dac0d674789d3a0c Mon Sep 17 00:00:00 2001 From: Christoph Dwertmann Date: Tue, 17 Mar 2015 18:22:29 +1100 Subject: Speed up indexer on lighttpd by using tpl_flush() --- lib/exe/indexer.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/exe') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 2de178caa..d2a4d45f7 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -199,8 +199,7 @@ function sendGIF(){ header('Content-Length: '.strlen($img)); header('Connection: Close'); print $img; - ob_flush(); - flush(); + tpl_flush(); // Browser should drop connection after this // Thinks it's got the whole image } -- cgit v1.2.3