From dfd1d9e27291753a603986671c5ebaa5149e0930 Mon Sep 17 00:00:00 2001 From: martinlanghoff Date: Mon, 17 Apr 2006 21:04:19 +0000 Subject: [PATCH] mod/chat - Normal method now support HTTP Keep-Alive By using output buffering, we now support HTTP Keep-Alive, which means that each client gets tightly bound to a single apache child - this means that we get + lower resource usage on the webserver + _much_ lower resource usage on webserver and dbserver if pconnects are used + a good case for further caching (memcache/mmcache) Using ab via localhost or fast LAN using keepalives is actually slower from the client perspective -- still lighter on the server. Via slower links (DSL/modem) the responses are faster. --- mod/chat/gui_header_js/jsupdate.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mod/chat/gui_header_js/jsupdate.php b/mod/chat/gui_header_js/jsupdate.php index ba008fa93b..9085349ae5 100644 --- a/mod/chat/gui_header_js/jsupdate.php +++ b/mod/chat/gui_header_js/jsupdate.php @@ -61,7 +61,8 @@ $chat_newrow = ($chat_lastrow + $num) % 2; - $refreshurl = "jsupdate.php?chat_sid=$chat_sid&chat_lasttime=$chat_newlasttime&chat_lastrow=$chat_newrow"; // no & in url, does not work in header! + // no & in url, does not work in header! + $refreshurl = "{$CFG->wwwroot}/mod/chat/gui_header_js/jsupdate.php?chat_sid=$chat_sid&chat_lasttime=$chat_newlasttime&chat_lastrow=$chat_newrow"; header('Expires: Sun, 28 Dec 1997 09:32:45 GMT'); header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); @@ -76,6 +77,10 @@ $stylesheetshtml .= ''; } + // use ob to be able to send Content-Length headers + // needed for Keep-Alive to work + ob_start(); + ?> @@ -151,3 +156,12 @@ Refresh link + -- 2.39.5