Monday, August 8, 2011

Enable GZIP in YII Application

Just add the following lines to protected/config/main.php,

add the below 2 lines after   'preload' => array('log'),

'onBeginRequest' => create_function('$event', 'return ob_start("ob_gzhandler");'),
'onEndRequest' => create_function('$event', 'return ob_end_flush();'),

No comments: