Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.606
diff -u -p -r1.606 theme.inc
--- includes/theme.inc	22 Aug 2010 12:46:21 -0000	1.606
+++ includes/theme.inc	5 Sep 2010 15:39:51 -0000
@@ -292,7 +292,7 @@ function _theme_load_registry($theme, $b
  * Write the theme_registry cache into the database.
  */
 function _theme_save_registry($theme, $registry) {
-  cache_set("theme_registry:$theme->name", $registry);
+  cache_set("theme_registry:$theme->name", $registry, 'cache_bootstrap');
 }
 
 /**
@@ -301,7 +301,13 @@ function _theme_save_registry($theme, $r
  * to add more theme hooks.
  */
 function drupal_theme_rebuild() {
-  cache_clear_all('theme_registry', 'cache', TRUE);
+  $cids = array();
+  $themes = list_themes();
+  foreach ($themes as $name => $theme) {
+    $cids[] = "theme_registry:$name";
+  }
+
+  cache_clear_all($cids, 'cache_bootstrap');
 }
 
 /**
