diff --git a/HexagonBase/hex.info b/HexagonBase/hex.info
index 274aa62..6ccb9b7 100644
--- a/HexagonBase/hex.info
+++ b/HexagonBase/hex.info
@@ -3,3 +3,7 @@ description = A base theme for creating highly configurable sub-themes.
 core   = 7.x
 engine = phptemplate
 hidden = TRUE
+
+cache handlers[files]    = includes/build_files.inc
+cache handlers[plugins]  = includes/build_plugins.inc
+cache handlers[settings] = includes/build_settings.inc
diff --git a/HexagonBase/includes/caching.inc b/HexagonBase/includes/caching.inc
new file mode 100644
index 0000000..24f0681
--- /dev/null
+++ b/HexagonBase/includes/caching.inc
@@ -0,0 +1,131 @@
+<?php
+
+/**
+ * @file caching.inc
+ * Caching API.
+ */
+
+/**
+ * Clears all caches held by Hexagon.
+ */
+function hex_clear_caches() {
+  $cache_cleared = &drupal_static('hex_cache_was_cleared', FALSE);
+  if (!$cache_cleared) {
+    cache_clear_all('hex_cache', 'cache', TRUE);
+    $cache_cleared = TRUE;
+  }
+  drupal_static_reset('hex_cache');
+  drupal_static_reset('hex_type');
+  drupal_static_reset('hex_list_interleaved');
+}
+
+/**
+ * Were the caches held by hexagon cleared?
+ *
+ * @return
+ *  Boolean TRUE or FALSE.
+ */
+function hex_cache_was_cleared() {
+  $cache_cleared = &drupal_static(__FUNCTION__, FALSE);
+  return $cache_cleared;
+}
+
+/**
+ * Hexagon caching API.
+ *
+ * Gets the cache for the given $cache_key. If it is not available, the
+ * function responsible for building it is called with the returned data saved
+ * to Drupal cores caching system.
+ *
+ * Any theme or plug-in can take advantage of this. In order to do so, it must
+ * add 'cache handlers' into their .info file (.pinfo for plug-ins).
+ *
+ *  cache handlers[$cache_key] = path/to/build_file.inc
+ *
+ * Then the theme or plug-in must create a function for building the cache.
+ * It must follow this naming pattern: [THEME|PLUGIN]_build_$cache_key. If the
+ * $cache_key is 'widgets' and the theme handling them is named 'foo' it would
+ * be named foo_build_widgets().
+ *
+ * @param $cache_key
+ *  The key used to identify and target the build.
+ */
+function hex_cache($cache_key) {
+  // Use the advanced drupal_static() pattern, since this is called very often.
+  static $drupal_static_fast;
+  if (!isset($drupal_static_fast)) {
+    $drupal_static_fast['caches'] = &drupal_static(__FUNCTION__);
+  }
+  // 'hex_cache:BUILD_KEY:THEME_TARGET'
+  $cid = "hex_cache:$cache_key:{$GLOBALS['theme_target']}";
+  $cached = &$drupal_static_fast['caches'][$cid];
+
+  if (!$cached && !$cached = cache_get($cid)) {
+    if ($handler = hex_get_cache_handler($cache_key)) {
+      timer_start($cid);
+
+      include_once DRUPAL_ROOT . '/' . $handler->file;
+      cache_set($cid, call_user_func($handler->func));
+      $cached = cache_get($cid);
+
+      timer_stop($cid);
+      hex_notify('!host created cache id !cid in !timer milliseconds.',
+                 array('!host'  => $handler->host, '!cid'   => $cid, '!timer' => timer_read($cid)),
+                 'debug');
+    }
+    else {
+      hex_notify('Cache id !cid could not be created. Cache handler not found.',
+                 array('!cid' => $cid),
+                 'error');
+    }
+  }
+
+  return $cached;
+}
+
+/**
+ * Gets the handler for the specified $cache_key.
+ *
+ * The first theme found that declares its handling (or its hosted plug-ins)
+ * starting from base will be used. Sub-themes redefining a cache key will not
+ * be used.
+ */
+function hex_get_cache_handler($cache_key) {
+  $handler = new stdClass();
+
+  // Ensure HEX_ACTIVE context.
+  hex_active_theme(HEX_ACTIVE, TRUE);
+
+  // If the $cache_key is 'plugins', process themes only.
+  if ($cache_key === 'plugins') {
+    // The unified functions (hex_info(), hex_type(), hex_path(), etc..)
+    // should not be used when processing plug-ins.
+    foreach (hex_active_themes() as $component) {
+      $handlers = hex_theme_info('cache handlers', array(), $component);
+      if (isset($handlers[$cache_key])) {
+        $handler->host = hex_theme_info('name', $component, $component);
+        $handler->type = 'theme';
+        $handler->func = "{$component}_build_$cache_key";
+        $handler->file = drupal_get_path('theme', $component) . '/' . $handlers[$cache_key];
+        break;
+      }
+    }
+  }
+  else {
+    foreach (hex_list('theme+plugin') as $component) {
+      $handlers = hex_info('cache handlers', array(), $component);
+      if (isset($handlers[$cache_key])) {
+        $handler->host = hex_info('name', $component, $component);
+        $handler->type = hex_type($component);
+        $handler->func = "{$component}_build_$cache_key";
+        $handler->file = hex_path($component) . '/' . $handlers[$cache_key];
+        break;
+      }
+    }
+  }
+
+  // Previous context.
+  hex_active_theme(HEX_PREVIOUS);
+
+  return $handler;
+}
diff --git a/HexagonBase/includes/meta_files.inc b/HexagonBase/includes/meta_files.inc
index a205694..70ad197 100644
--- a/HexagonBase/includes/meta_files.inc
+++ b/HexagonBase/includes/meta_files.inc
@@ -74,7 +74,7 @@
  *  the scope set from .info/.pinfo.
  */
 function hex_file_path($namespace, $scope = 'all') {
-  $files = hex_cache('files', 'hex')->data;
+  $files = hex_cache('files')->data;
   return isset($files[$scope][$namespace]) ? end($files[$scope][$namespace]) : NULL;
 }
 
@@ -94,6 +94,6 @@ function hex_file_path($namespace, $scope = 'all') {
  *  the scope set from .info/.pinfo.
  */
 function hex_file_path_multiple($namespace, $scope = 'all') {
-  $files = hex_cache('files', 'hex')->data;
+  $files = hex_cache('files')->data;
   return !empty($files[$scope][$namespace]) ? $files[$scope][$namespace] : array();
 }
diff --git a/HexagonBase/includes/meta_plugin.inc b/HexagonBase/includes/meta_plugin.inc
index 156ff7c..32c4462 100644
--- a/HexagonBase/includes/meta_plugin.inc
+++ b/HexagonBase/includes/meta_plugin.inc
@@ -16,8 +16,8 @@ define('JS_PLUGIN',  200);
  *  (required) The plug-in to target.
  */
 function hex_plugin_info($pinfo_key, $default, $plugin) {
+  $data = hex_cache('plugins')->data;
 
-  $data = hex_cache('plugins', 'hex')->data;
   if (isset($data['plugins'][$plugin]->info[$pinfo_key])) {
     $plugin_info = $data['plugins'][$plugin]->info[$pinfo_key];
   }
@@ -57,7 +57,7 @@ function hex_plugin_exists($plugin, $set = 'all.active') {
  *  (required) The plug-in name.
  */
 function hex_plugin_path($plugin) {
-  $data = hex_cache('plugins', 'hex')->data;
+  $data = hex_cache('plugins')->data;
   return isset($data['plugins'][$plugin]) ? $data['plugins'][$plugin]->directory : NULL;
 }
 
@@ -83,7 +83,7 @@ function hex_plugin_path($plugin) {
  *  plug-in's hosted in disabled themes.
  */
 function hex_plugin_list($set = 'all.active') {
-  $data = hex_cache('plugins', 'hex')->data;
+  $data = hex_cache('plugins')->data;
   return isset($data['lists'][$set]) ? $data['lists'][$set] : array();
 }
 
@@ -93,7 +93,7 @@ function hex_plugin_list($set = 'all.active') {
  * @see hex_plugin_lists()
  */
 function hex_plugin_sets() {
-  return array_keys(hex_cache('plugins', 'hex')->data['lists']);
+  return array_keys(hex_cache('plugins')->data['lists']);
 }
 
 /**
diff --git a/HexagonBase/includes/meta_theme.inc b/HexagonBase/includes/meta_theme.inc
index 837b62e..c69bd72 100644
--- a/HexagonBase/includes/meta_theme.inc
+++ b/HexagonBase/includes/meta_theme.inc
@@ -145,7 +145,7 @@ function hex_theme_info($info_key, $default = NULL, $theme = HEX_ACTIVE) {
  *  values allowed are HEX_CASCADE (default), HEX_ACTIVE or HEX_THEMEAPI.
  */
 function hex_setting($name = NULL, $default = NULL, $theme = HEX_CASCADE) {
-  $cache = hex_cache('settings', 'hex')->data;
+  $cache = hex_cache('settings')->data;
 
   if ($theme === HEX_ACTIVE || $theme === HEX_THEMEAPI) {
     $theme = hex_active_theme($theme);
@@ -176,7 +176,7 @@ function hex_setting($name = NULL, $default = NULL, $theme = HEX_CASCADE) {
  *  Array of setting keys and their scope.
  */
 function hex_settings($setting_keys) {
-  $cache = hex_cache('settings', 'hex')->data;
+  $cache = hex_cache('settings')->data;
 
   foreach ($setting_keys as $setting_key => $scope) {
     $settings[$setting_key] = $scopes = array();
diff --git a/HexagonBase/template.php b/HexagonBase/template.php
index 9885bd2..b936b27 100644
--- a/HexagonBase/template.php
+++ b/HexagonBase/template.php
@@ -18,6 +18,7 @@ function _hex_initialize() {
   $GLOBALS['theme_static'] = $GLOBALS['theme_key'];
   $GLOBALS['theme_target'] = $GLOBALS['theme_key'];
 
+  include_once HEX_INCLUDES . '/caching.inc';
   include_once HEX_INCLUDES . '/meta_theme.inc';
   include_once HEX_INCLUDES . '/meta_plugin.inc';
   include_once HEX_INCLUDES . '/meta_files.inc';
@@ -57,78 +58,3 @@ function _hex_initialize() {
     }
   }
 }
-
-/**
- * Hexagon caching API.
- *
- * Gets the cache for the given $cache_key. If it is not available, the
- * function responsible for building it is called with the returned data saved
- * to Drupal cores caching system.
- *
- * Any theme or plug-in can take advantage of this. In order to do so, it must
- * implement hook_cache_build(). The 'hook' is determined by the $host
- * parameter. It is the theme or plug-in handling the particular $cache_key.
- *
- * @param $cache_key
- *  The key used to store and retrieve the cache.
- * @param $host
- *  The host theme or plug-in responsible for building the cache.
- */
-function hex_cache($cache_key, $host) {
-  // Use the advanced drupal_static() pattern, since this is called very often.
-  static $drupal_static_fast;
-  if (!isset($drupal_static_fast)) {
-    $drupal_static_fast['caches'] = &drupal_static(__FUNCTION__);
-  }
-  $cid = $host . '_cache:' . $cache_key . ':' . $GLOBALS['theme_target'];
-  $cached = &$drupal_static_fast['caches'][$cid];
-
-  if (!isset($cached) && !$cached = cache_get($cid)) {
-    timer_start($cid);
-
-    cache_set($cid, call_user_func($host . '_cache_build', $cache_key));
-    $cached = cache_get($cid);
-
-    timer_stop($cid);
-    hex_notify('Created and saved cache id !id in !timer milliseconds.',
-               array('!id' => $cid, '!timer' => timer_read($cid)),
-               'debug');
-  }
-
-  return $cached;
-}
-
-/**
- * implements hook_cache_build()
- *
- * This includes the file responsible for building the cache and invokes the
- * function that builds it returning the built data. Called from hex_cache()
- * which will save it to Drupal cores caching system.
- */
-function hex_cache_build($cache_key) {
-  include_once HEX_INCLUDES . "/build_$cache_key.inc";
-  return call_user_func("hex_build_$cache_key");
-}
-
-/**
- * Clears all caches held by Hexagon.
- */
-function hex_clear_caches() {
-  $cache_cleared = &drupal_static('hex_cache_was_cleared', FALSE);
-  if (!$cache_cleared) {
-    drupal_static_reset('hex_cache');
-    cache_clear_all('hex_cache', 'cache', TRUE);
-    $cache_cleared = TRUE;
-  }
-}
-
-/**
- * Were the caches held by hexagon cleared?
- *
- * @return
- *  Boolean TRUE or FALSE.
- */
-function hex_cache_was_cleared() {
-  $cache_cleared = &drupal_static(__FUNCTION__, FALSE);
-  return $cache_cleared;
-}

