diff --git a/system/application/config/config.php b/system/application/config/config.php
index 7b19b83..e88abd9 100644
--- a/system/application/config/config.php
+++ b/system/application/config/config.php
@@ -204,7 +204,6 @@
 */
 $config['cache_path'] = '';
 
-
 /*
 |--------------------------------------------------------------------------
 | Encryption Key
@@ -216,7 +215,6 @@
 */
 $config['encryption_key'] = "";
 
-
 /*
 |--------------------------------------------------------------------------
 | Session Variables
@@ -236,7 +234,6 @@
 $config['sess_match_ip']		= TRUE;
 $config['sess_match_useragent']	= TRUE;
 
-
 /*
 |--------------------------------------------------------------------------
 | Cookie Related Variables
@@ -262,5 +259,24 @@
 */
 $config['global_xss_filtering'] = FALSE;
 
+/*
+|--------------------------------------------------------------------------
+| Output Compression
+|--------------------------------------------------------------------------
+|
+| Enables output compression using Gzip for faster page loads.  When enabled,
+| the output class will test whether the server your site is running on 
+| supports Gzip. Even if it does, however, not all browsers support compression
+| so enable only if you are reasonably sure your visitors can handle it.
+|
+| VERY IMPORTANT:  If you are getting a blank page when this is enabled it
+| means you are prematurely outputing something to your browser. It could
+| even be a line of whitespace at the end of one of your scripts.  For 
+| compression to work, nothing can be sent before the output buffer is called
+| by the output class.
+|
+*/
+$config['compress_output'] = TRUE;
+
 
 ?>
\ No newline at end of file
diff --git a/system/libraries/Output.php b/system/libraries/Output.php
index b09bf2a..4a3adb8 100644
--- a/system/libraries/Output.php
+++ b/system/libraries/Output.php
@@ -86,7 +86,6 @@
 	{
 		$this->headers[] = $header;
 	}
-
 	
 	// --------------------------------------------------------------------
 	
@@ -145,6 +144,19 @@
 		$output = str_replace('{memory_usage}', $memory, $output);		
 		$output = str_replace('{elapsed_time}', $elapsed, $output);
 		
+		// Is compression requested?
+		$CFG =& _load_class('CI_Config');
+		if ($CFG->item('compress_output') === TRUE)
+		{
+			if (extension_loaded('zlib'))
+			{
+				if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) AND strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE)
+				{
+					ob_start('ob_gzhandler');
+				}
+			}
+		}
+		
 		// Are there any server headers to send?
 		if (count($this->headers) > 0)
 		{