diff --git a/include/utils/utils.php b/include/utils/utils.php
index b30dd3a3ab5e5f5c1718cb55fbfbdb042c1bfe80..d16865076c28655d32c41e6d05358c3fd81a9ddf 100755
--- a/include/utils/utils.php
+++ b/include/utils/utils.php
@@ -345,9 +345,14 @@ $toHtml = array(
        */
 function to_html($string, $encode=true)
 {
+        $startstring=$string;
+	$cachedresult=Vtiger_Cache::get('to_html',$startstring);
+	if($cachedresult){
+		return $cachedresult;
+	}
+
 	global $log,$default_charset;
 	//$log->debug("Entering to_html(".$string.",".$encode.") method ...");
-	global $toHtml;
 	$action = $_REQUEST['action'];
 	$search = $_REQUEST['search'];
 
@@ -385,6 +390,7 @@ function to_html($string, $encode=true)
 	}
 
 	//$log->debug("Exiting to_html method ...");
+	Vtiger_Cache::set('to_html', $startstring, $string);
 	return $string;
 }