diff --git a/sites/all/modules/contrib/homebox/homebox.module b/sites/all/modules/contrib/homebox/homebox.module
index 6b00a2e..a5ea3ed 100644
--- a/sites/all/modules/contrib/homebox/homebox.module
+++ b/sites/all/modules/contrib/homebox/homebox.module
@@ -805,13 +805,45 @@ function homebox_homebox_block_edit_form($block) {
  *   Boolean value of user's access to the block
  */
 function _homebox_can_view_block($block, $user = NULL) {
-  // Use current user if non provided
-  if (!$user) {
-    global $user;
-  }
+  // Define static variable
+  $homebox_roles = &drupal_static(__FUNCTION__);
+
+  // Only process if static variable is not set
+  if (!isset($homebox_roles[$block->module . '_' . $block->delta])) {
+
+    // Use current user if none provided
+    if (!$user) {
+      global $user;
+    }
+
+    // Check if roles are cached
+    $cid = 'homebox_' . $block->module . '_' . $block->delta . '_roles';
+    $cache = cache_get($cid);
 
-  // Check for roles set at the block level
-  $allowed_roles = db_query("SELECT rid FROM {block_role} WHERE module = :module AND delta = :delta", array(':module' => $block->module, ':delta' => $block->delta));
+    // Only execute if not cached
+    if (!$cache) {
+
+      // Check for roles set at the block level
+      $roles = array();
+      $allowed_roles = db_query("SELECT rid FROM {block_role} WHERE module = :module AND delta = :delta", array(':module' => $block->module, ':delta' => $block->delta));
+      while ($role = db_fetch_object($allowed_roles)) {
+        $roles[] = $role;
+      }
+
+      // Cache the roles
+      cache_set($cid, $roles);
+    }
+    else {
+      // Get roles from cache
+      $roles = $cache->data;
+    }
+    // Set static variable
+    $homebox_roles[$block->module . '_' . $block->delta] = $roles;
+  }
+  else {
+    // Static variable was set
+    $roles = $homebox_roles[$block->module . '_' . $block->delta];
+  }
 
   // Indicate whether or not role restrictions were set on the block
   $role_set = FALSE;
