From: martinlanghoff Date: Mon, 17 Apr 2006 21:04:19 +0000 (+0000) Subject: mod/chat - Normal method now support HTTP Keep-Alive X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=dfd1d9e27291753a603986671c5ebaa5149e0930;p=moodle.git 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. --- 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 +