Works with set_content_type() to automatically minify for current mime type.
diff --git a/system/core/Output.php b/system/core/Output.php
index c95f551..904e7af 100755
--- a/system/core/Output.php
+++ b/system/core/Output.php
@@ -65,6 +65,12 @@
 	 */
 	protected $mime_types		= array();
 	/**
+	 * Mime-type for the current page
+	 *
+	 * @var array
+	 */
+	protected $mime_type		= NULL;
+	/**
 	 * Determines wether profiler is enabled
 	 *
 	 * @var book
@@ -216,6 +222,8 @@
 				}
 			}
 		}
+		
+		$this->mime_type = $mime_type;
 
 		$header = 'Content-Type: '.$mime_type;
 
@@ -329,7 +337,7 @@
 		// Is minify requested?
 		if ($CFG->item('minify_output') === TRUE)
 		{
-			$output = $this->minify($output);
+			$output = $this->minify($output,$this->mime_type);
 		}
 
 
@@ -579,6 +587,13 @@
 	 */
 	public function minify($output,$type='text/html')
 	{
+		if($type===NULL)
+		{
+			$type = 'text/html';
+		}
+		
+		die($type);
+		
 		switch ($type)
 		{
 			case 'text/html':