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(+) 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