[Phpfreechat-svn] SF.net SVN: phpfreechat: [823] trunk/src/client/proxy.php.tpl
Status: Beta
Brought to you by:
kerphi
From: <ke...@us...> - 2006-10-06 07:53:30
|
Revision: 823 http://svn.sourceforge.net/phpfreechat/?rev=823&view=rev Author: kerphi Date: 2006-10-06 00:53:24 -0700 (Fri, 06 Oct 2006) Log Message: ----------- [en] Bug fix: try to fix slow loading (>60sec) with gzip php output module [1h00] [fr] Bug fix : essai de r?\195?\169solution du probl?\195?\168me de chargement lent (>60sec) lorsque le module gzip est activ?\195?\169 dans php [1h00] Modified Paths: -------------- trunk/src/client/proxy.php.tpl Modified: trunk/src/client/proxy.php.tpl =================================================================== --- trunk/src/client/proxy.php.tpl 2006-10-06 06:35:09 UTC (rev 822) +++ trunk/src/client/proxy.php.tpl 2006-10-06 07:53:24 UTC (rev 823) @@ -1,5 +1,10 @@ <?php +// gzip compression should not be used because it can slowdown a lot the page loading (>60 seconds!) +ini_set('zlib.output_compression','Off'); + +ob_start(); // start capturing output + $rootpath = dirname(__FILE__)."/../../"; $allowedpath = array(); @@ -29,15 +34,27 @@ else $file = $found; +// setup the HTTP cache +// @todo understand how it really works +session_cache_limiter('public'); + +// output the file content +readfile($file); + +// output HTTP headers $contenttype = "text/plain"; -$contentlength = filesize($file); +//$contentlength = filesize($file); if (preg_match("/.js$/", $file)) $contenttype = "text/javascript"; else if (preg_match("/.css$/", $file)) $contenttype = "text/css"; +header("Content-Type: ".$contenttype); +$contentlength = ob_get_length(); header("Content-Length: ".$contentlength); -header("Content-Type: ".$contenttype); -session_cache_limiter('public'); -echo file_get_contents($file); -flush(); // needed to fix problems with gzhandler enabled + +// As far as I can tell the only way to mimic ob_flush()'s behaviour on PHP < 4.2.0 is calling ob_end_flush() followed by ob_start(). +// http://fr.php.net/manual/en/function.ob-flush.php#28477 +ob_end_flush(); +ob_start(); + ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |