Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.967
diff -u -p -r1.967 node.module
--- modules/node/node.module	26 May 2008 17:12:55 -0000	1.967
+++ modules/node/node.module	25 Jun 2008 07:44:05 -0000
@@ -421,6 +421,23 @@ function node_teaser($body, $format = NU
 }
 
 /**
+ * Returns the cid for use with caching.
+ *
+ * @return
+ *   A string with the cid used for the caching system.
+ */
+function node_types_get_cache_cid() {
+  $cid = 'node_types';
+  if (module_exists('locale')) {
+    global $language;
+    
+    $cid .= '_'.$language->language;    
+  }
+
+  return $cid;
+}
+
+/**
  * Builds a list of available node types, and returns all of part of this list
  * in the specified format.
  *
@@ -441,6 +458,12 @@ function node_teaser($body, $format = NU
  */
 function node_get_types($op = 'types', $node = NULL, $reset = FALSE) {
   static $_node_types, $_node_names;
+  
+  if (!$reset && !isset($_node_types)) {
+    if ($node_types_cache = cache_get(node_types_get_cache_cid(), 'cache')) { 
+      list($_node_types, $_node_names) = $node_types_cache->data;
+    }
+  }
 
   if ($reset || !isset($_node_types)) {
     list($_node_types, $_node_names) = _node_types_build();
@@ -598,7 +621,9 @@ function _node_types_build() {
   }
 
   asort($_node_names);
-
+  
+  cache_set(node_types_get_cache_cid(), array($_node_types, $_node_names), 'cache');
+  
   return array($_node_types, $_node_names);
 }
 
