diff --git a/page_theme.module b/page_theme.module
index b0a3a0a..484542e 100644
--- a/page_theme.module
+++ b/page_theme.module
@@ -142,6 +142,15 @@ function page_theme_custom_theme() {
 
 
 /**
+ * Implements hook_flush_caches().
+ */
+function page_theme_flush_caches() {
+
+  cache_clear_all('page_theme:themes', 'cache');
+}
+
+
+/**
  *  Helper functions.
  */
 function page_theme_get_theme_options() {
@@ -168,22 +177,30 @@ function page_theme_get_theme_options() {
 
 function page_theme_get_themes($theme = NULL) {
 
-  static $themes = array();
+  $themes = &drupal_static(__FUNCTION__);
 
-  if (!$themes) {
+  if (!isset($themes)) {
 
-    foreach (system_rebuild_theme_data() as $theme_data) {
+    if ($cache = cache_get('page_theme:themes')) {
+      $themes = $cache->data;
+    }
+    else {
+
+      foreach (system_rebuild_theme_data() as $theme_data) {
 
-      $visibility = empty($theme_data->info['hidden']);
-      $compatible_core = isset($theme_data->info['core']) && $theme_data->info['core'] == DRUPAL_CORE_COMPATIBILITY && isset($theme_data->info['regions']['content']);
-      $compatible_php = version_compare(phpversion(), $theme_data->info['php'], '>=');
+        $visibility = empty($theme_data->info['hidden']);
+        $compatible_core = isset($theme_data->info['core']) && $theme_data->info['core'] == DRUPAL_CORE_COMPATIBILITY && isset($theme_data->info['regions']['content']);
+        $compatible_php = version_compare(phpversion(), $theme_data->info['php'], '>=');
 
-      if ($visibility && $compatible_core && $compatible_php) {
-        $themes[$theme_data->name] = $theme_data->info['name'];
+        if ($visibility && $compatible_core && $compatible_php) {
+          $themes[$theme_data->name] = $theme_data->info['name'];
+        }
       }
-    }
 
-    asort($themes);
+      asort($themes);
+
+      cache_set('page_theme:themes', $themes);
+    }
   }
 
   return !is_null($theme) ? (isset($themes[$theme]) ? $themes[$theme] : $theme) : $themes;
