From 88d7cabacb01660f4e7d669efc819e07e4c3fa76 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 28 Mar 2022 08:46:02 +0000 Subject: [PATCH] Commit --- app/lib/App/SSE/EventLoop.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/lib/App/SSE/EventLoop.php b/app/lib/App/SSE/EventLoop.php index f2767f7..4c0af69 100644 --- a/app/lib/App/SSE/EventLoop.php +++ b/app/lib/App/SSE/EventLoop.php @@ -24,19 +24,20 @@ class EventLoop session_write_close(); } - header("Cache-Control: no-store"); - header("Content-Type: text/event-stream"); - header('X-Accel-Buffering: no'); // for nginx buffering + header('Cache-Control: no-store, must-revalidate'); + header('Content-Type: text/event-stream'); + // explicitly disable caching so varnish and other upstreams won't cache. + header('Cache-Control: no-cache, must-revalidate'); + // instruct nginx to disable fastcgi_buffering and disable gzip + header('X-Accel-Buffering: no'); // send headers to client indicating we are now a stream ob_end_flush(); flush(); - $expirationTime = time() + $this->timeLimit; - $lastHeartbeat = time(); - while (!connection_aborted() && time() < $expirationTime) + while (!connection_aborted() && time() < (time() + $this->timeLimit)) { set_time_limit($this->execLimit); try {