diff --git a/libraries.module b/libraries.module
index 059bfea..ef34c3b 100644
--- a/libraries.module
+++ b/libraries.module
@@ -412,16 +412,6 @@ function libraries_info_defaults(&$library, $name) {
 /**
  * Tries to detect a library and its installed version.
  *
- * @todo We need to figure out whether, and if, how we want to retain the
- *   processed information. I.e. either use a static cache here, or make
- *   libraries_info() conditionally invoke libraries_detect($name). D7 only way:
- *   Re-use drupal_static() of libraries_info() - but would still require to
- *   update the (DB) cache (there likely will be one soon). Also, we probably do
- *   not want to ALWAYS parse ALL possible libraries; rather, the
- *   requesting/consuming module likely wants to know whether a list of
- *   supported libraries (possibly those registered by itself, or in a certain
- *   "category") is available... Food for thought.
- *
  * @param $name
  *   The machine name of a library to return registered information for.
  *
@@ -441,104 +431,113 @@ function libraries_info_defaults(&$library, $name) {
  * @see libraries_info()
  */
 function libraries_detect($name) {
-  $library = libraries_info($name);
-
-  $library['installed'] = FALSE;
+  $libraries = &drupal_static(__FUNCTION__, array());
 
-  // Check whether the library exists.
-  if (!isset($library['library path'])) {
-    $library['library path'] = libraries_get_path($library['machine name']);
-  }
-  if ($library['library path'] === FALSE || !file_exists($library['library path'])) {
-    $library['error'] = 'not found';
-    $library['error message'] = t('The %library library could not be found.', array(
-      '%library' => $library['name'],
-    ));
-    return $library;
-  }
+  if (!isset($libraries[$name])) {
+    $library = libraries_info($name);
 
-  // Invoke callbacks in the 'pre-detect' group.
-  libraries_invoke('pre-detect', $library);
+    $library['installed'] = FALSE;
 
-  // Detect library version, if not hardcoded.
-  if (!isset($library['version'])) {
-    // We support both a single parameter, which is an associative array, and an
-    // indexed array of multiple parameters.
-    if (isset($library['version arguments'][0])) {
-      // Add the library as the first argument.
-      $library['version'] = call_user_func_array($library['version callback'], array_merge(array($library), $library['version arguments']));
+    // Check whether the library exists.
+    if (!isset($library['library path'])) {
+      $library['library path'] = libraries_get_path($library['machine name']);
     }
-    else {
-      $library['version'] = $library['version callback']($library, $library['version arguments']);
-    }
-    if (empty($library['version'])) {
-      $library['error'] = 'not detected';
-      $library['error message'] = t('The version of the %library library could not be detected.', array(
+    if ($library['library path'] === FALSE || !file_exists($library['library path'])) {
+      $library['error'] = 'not found';
+      $library['error message'] = t('The %library library could not be found.', array(
         '%library' => $library['name'],
       ));
-      return $library;
+      $libraries[$name] = $library;
+      return $libraries[$name];
     }
-  }
 
-  // Determine to which supported version the installed version maps.
-  if (!empty($library['versions'])) {
-    ksort($library['versions']);
-    $version = 0;
-    foreach ($library['versions'] as $supported_version => $version_properties) {
-      if (version_compare($library['version'], $supported_version, '>=')) {
-        $version = $supported_version;
+    // Invoke callbacks in the 'pre-detect' group.
+    libraries_invoke('pre-detect', $library);
+
+    // Detect library version, if not hardcoded.
+    if (!isset($library['version'])) {
+      // We support both a single parameter, which is an associative array, and an
+      // indexed array of multiple parameters.
+      if (isset($library['version arguments'][0])) {
+        // Add the library as the first argument.
+        $library['version'] = call_user_func_array($library['version callback'], array_merge(array($library), $library['version arguments']));
+      }
+      else {
+        $library['version'] = $library['version callback']($library, $library['version arguments']);
+      }
+      if (empty($library['version'])) {
+        $library['error'] = 'not detected';
+        $library['error message'] = t('The version of the %library library could not be detected.', array(
+          '%library' => $library['name'],
+        ));
+        $libraries[$name] = $library;
+        return $libraries[$name];
       }
     }
-    if (!$version) {
-      $library['error'] = 'not supported';
-      $library['error message'] = t('The installed version %version of the %library library is not supported.', array(
-        '%version' => $library['version'],
-        '%library' => $library['name'],
-      ));
-      return $library;
-    }
-
-    // Apply version specific definitions and overrides.
-    $library = array_merge($library, $library['versions'][$version]);
-    unset($library['versions']);
-  }
 
-  // Check each variant if it is installed.
-  if (!empty($library['variants'])) {
-    foreach ($library['variants'] as $variant_name => &$variant) {
-      // If no variant callback has been set, assume the variant to be
-      // installed.
-      if (!isset($variant['variant callback'])) {
-        $variant['installed'] = TRUE;
+    // Determine to which supported version the installed version maps.
+    if (!empty($library['versions'])) {
+      ksort($library['versions']);
+      $version = 0;
+      foreach ($library['versions'] as $supported_version => $version_properties) {
+        if (version_compare($library['version'], $supported_version, '>=')) {
+          $version = $supported_version;
+        }
       }
-      else {
-        // We support both a single parameter, which is an associative array,
-        // and an indexed array of multiple parameters.
-        if (isset($variant['variant arguments'][0])) {
-          // Add the library as the first argument, and the variant name as the second.
-          $variant['installed'] = call_user_func_array($variant['variant callback'], array_merge(array($library, $variant_name), $variant['variant arguments']));
+      if (!$version) {
+        $library['error'] = 'not supported';
+        $library['error message'] = t('The installed version %version of the %library library is not supported.', array(
+          '%version' => $library['version'],
+          '%library' => $library['name'],
+        ));
+        $libraries[$name] = $library;
+        return $libraries[$name];
+      }
+
+      // Apply version specific definitions and overrides.
+      $library = array_merge($library, $library['versions'][$version]);
+      unset($library['versions']);
+    }
+
+    // Check each variant if it is installed.
+    if (!empty($library['variants'])) {
+      foreach ($library['variants'] as $variant_name => &$variant) {
+        // If no variant callback has been set, assume the variant to be
+        // installed.
+        if (!isset($variant['variant callback'])) {
+          $variant['installed'] = TRUE;
         }
         else {
-          $variant['installed'] = $variant['variant callback']($library, $variant_name, $variant['variant arguments']);
-        }
-        if (!$variant['installed']) {
-          $variant['error'] = 'not found';
-          $variant['error message'] = t('The %variant variant of the %library library could not be found.', array(
-            '%variant' => $variant_name,
-            '%library' => $library['name'],
-          ));
+          // We support both a single parameter, which is an associative array,
+          // and an indexed array of multiple parameters.
+          if (isset($variant['variant arguments'][0])) {
+            // Add the library as the first argument, and the variant name as the second.
+            $variant['installed'] = call_user_func_array($variant['variant callback'], array_merge(array($library, $variant_name), $variant['variant arguments']));
+          }
+          else {
+            $variant['installed'] = $variant['variant callback']($library, $variant_name, $variant['variant arguments']);
+          }
+          if (!$variant['installed']) {
+            $variant['error'] = 'not found';
+            $variant['error message'] = t('The %variant variant of the %library library could not be found.', array(
+              '%variant' => $variant_name,
+              '%library' => $library['name'],
+            ));
+          }
         }
       }
     }
-  }
 
-  // If we end up here, the library should be usable.
-  $library['installed'] = TRUE;
+    // If we end up here, the library should be usable.
+    $library['installed'] = TRUE;
 
-  // Invoke callbacks in the 'post-detect' group.
-  libraries_invoke('post-detect', $library);
+    // Invoke callbacks in the 'post-detect' group.
+    libraries_invoke('post-detect', $library);
 
-  return $library;
+    $libraries[$name] = $library;
+  }
+
+  return $libraries[$name];
 }
 
 /**
