diff --git captcha.module captcha.module
index 0ea2cb0..c3d9713 100644
--- captcha.module
+++ captcha.module
@@ -275,16 +275,23 @@ function theme_captcha($element) {
 /**
  * Get the CAPTCHA setting for a given form_id.
  *
- * @param $form_id
- * @return NULL if no setting is known or a captcha_point object with fields 'module' and 'type'.
+ * @param $form_id The ID of the form to retrieve the setting for.
+ * @param $reset Optional flag, when TRUE will force rebuilding the internal static cache from the database.
+ * @return NULL if no setting is known or a captcha_point object with fields 'module', 'type' and 'form_id'.
  */
-function captcha_get_form_id_setting($form_id) {
-  $result = db_query("SELECT module, type FROM {captcha_points} WHERE form_id = '%s'", $form_id);
-  if (!$result) {
-    return NULL;
+function captcha_get_form_id_setting($form_id, $reset = FALSE) {
+  static $captcha_points = NULL;
+
+  if ($captcha_points === NULL || $reset) {
+    $captcha_points = array();
+
+    $result = db_query("SELECT form_id, module, type FROM {captcha_points}");
+    while ($point = db_fetch_object($result)) {
+      $captcha_points[$point->form_id] = $point;
+    }
   }
-  $captcha_point = db_fetch_object($result);
-  return $captcha_point;
+
+  return isset($captcha_points[$form_id]) ? $captcha_points[$form_id] : NULL;
 }
 
 /**
