diff --git a/boxes.admin.inc b/boxes.admin.inc
index 6e6efa4..4bfc3c6 100644
--- a/boxes.admin.inc
+++ b/boxes.admin.inc
@@ -91,18 +91,38 @@ function theme_boxes_box($variables) {
     }
   }
 
-  $output = "<div id='boxes-box-" . $block['delta'] . "' class='boxes-box" . (!empty($block['editing']) ? ' boxes-box-editing' : '') . $empty . "'>";
-  $output .= '<div class="boxes-box-content">' . $block['content'] . '</div>';
+  // Build the prefix and suffix markup separately, as it's complexx and depends
+  // on a number of factors.
+  $prefix = "<div id='boxes-box-" . $block['delta'] . "' class='boxes-box" . (!empty($block['editing']) ? ' boxes-box-editing' : '') . $empty . "'>";
+  $prefix .= '<div class="boxes-box-content">';
+
+  $suffix = '</div>';
   if (!empty($block['controls'])) {
-    $output .= '<div class="boxes-box-controls">';
-    $output .= $block['controls'];
-    $output .= '</div>';
+    $suffix .= '<div class="boxes-box-controls">';
+    $suffix .= $block['controls'];
+    $suffix .= '</div>';
   }
   if (!empty($block['editing'])) {
-    $output .= '<div class="box-editor">' . drupal_render($block['editing']) . '</div>';
+    $suffix .= '<div class="box-editor">' . drupal_render($block['editing']) . '</div>';
   }
-  $output .= '</div>';
-  return $output;
+  $suffix .= '</div>';
+
+  $build = array(
+    '#prefix' => $prefix,
+    '#suffix' => $suffix,
+  );
+
+  // Allow the content returned by the box's render() method to be either
+  // a string or a render array. The latter allows better use of the caching
+  // system.
+  if (is_array($block['content'])) {
+    $build['content'] = $block['content'];
+  }
+  else {
+    $build['#markup'] = $block['content'];
+  }
+
+  return $build;
 }
 
 /**
diff --git a/plugins/boxes_box.inc b/plugins/boxes_box.inc
index 224f07f..3463a6f 100644
--- a/plugins/boxes_box.inc
+++ b/plugins/boxes_box.inc
@@ -153,11 +153,16 @@ abstract class boxes_box {
   abstract public function options_form(&$form_state);
 
   /**
-   * Render a block. Must return an array with the keys
-   * 'delta', 'title', 'subject' (same as title) and 'content'.
+   * Render a block.
    *
-   * title AND subject need to be present to avoid that block module overrides
-   * title.
+   * @return
+   *  An array with the following keys:
+   *    - 'delta': The block delta.
+   *    - 'title': The block title.
+   *    - 'subject': Same as title. 'title' AND 'subject' need to be present to
+   *      avoid that block module overrides title.
+   *    - 'content': The block content. May be either a string of HTML or a
+   *      render array, or empty.
    */
   abstract public function render();
 }
