Index: modules/node/node.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.module,v
retrieving revision 1.1294
diff -u -p -r1.1294 node.module
--- modules/node/node.module	30 Aug 2010 05:58:46 -0000	1.1294
+++ modules/node/node.module	31 Aug 2010 11:36:26 -0000
@@ -465,6 +465,7 @@ function node_type_get_name($node) {
  */
 function node_types_rebuild() {
   // Reset and load updated node types.
+  cache_clear_all('node_types', 'cache');
   drupal_static_reset('_node_types_build');
   foreach (node_type_get_types() as $type => $info) {
     if (!empty($info->is_new)) {
@@ -681,6 +682,12 @@ function _node_types_build() {
   if (is_object($_node_types)) {
     return $_node_types;
   }
+
+  if ($cache = cache_get('node_types') {
+    $_node_types = $cache->data;
+    return $_node_types;
+  }
+
   $_node_types = (object)array('types' => array(), 'names' => array());
 
   $info_array = module_invoke_all('node_info');
@@ -716,6 +723,8 @@ function _node_types_build() {
 
   asort($_node_types->names);
 
+  cache_set('node_types', $_node_types);
+
   return $_node_types;
 }
 
