diff --git a/includes/cache.inc b/includes/cache.inc
index 9b60a7e..d1d3408 100644
--- a/includes/cache.inc
+++ b/includes/cache.inc
@@ -280,6 +280,24 @@ interface DrupalCacheInterface {
   function set($cid, $data, $expire = CACHE_PERMANENT);
 
   /**
+   * Store multiple items in the persistent cache.
+   *
+   * @param $items
+   *   An array of cache items in the form:
+   *   @code
+   *   $items = array(
+   *     $cid => array(
+   *       // Required, will be automatically serialized if not a string.
+   *       'data' => $data,
+   *       // Optional, defaults to CACHE_PERMANENT if not set.
+   *       'expire' => CACHE_PERMANENT,
+   *     ),
+   *   );
+   *   @endcode
+   */
+  function setMultiple(array $items);
+
+  /**
    * Delete an item from the cache.
    *
    * @param $cid
@@ -293,7 +311,7 @@ interface DrupalCacheInterface {
    * @param $cids
    *   An array of $cids to delete.
    */
-  function deleteMultiple(Array $cids);
+  function deleteMultiple(array $cids);
 
   /**
    * Delete items from the cache using a wildcard prefix.
@@ -459,7 +477,28 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
         ->execute();
     }
     catch (Exception $e) {
-      // The database may not be available, so we'll ignore cache_set requests.
+      // The database may not be available, so we'll ignore errors.
+    }
+  }
+
+  function setMultiple(array $items) {
+    try {
+      $this->deleteMultiple(array_keys($items));
+      $query = db_insert($this->bin)->fields(array('cid', 'data', 'expire', 'created', 'serialized'));
+      foreach ($items as $cid => $item) {
+        $fields = array(
+          'cid' => $cid,
+          'data' => is_string($item['data']) ? $item['data'] : serialize($item['data']),
+          'expire' => isset($item['expire']) ? $item['expire'] : CACHE_PERMANENT,
+          'created' => REQUEST_TIME,
+          'serialized' => is_string($item['data']) ? 0 : 1,
+        );
+        $query->values($fields);
+      }
+      $query->execute();
+    }
+    catch (Exception $e) {
+      // The database may not be available, so we'll ignore errors.
     }
   }
 
@@ -469,7 +508,7 @@ class DrupalDatabaseCache implements DrupalCacheInterface {
       ->execute();
   }
 
-  function deleteMultiple(Array $cids) {
+  function deleteMultiple(array $cids) {
     // Delete in chunks when a large array is passed.
     do {
       db_delete($this->bin)
diff --git a/modules/simpletest/tests/cache.test b/modules/simpletest/tests/cache.test
index 1f3240d..f39f5d8 100644
--- a/modules/simpletest/tests/cache.test
+++ b/modules/simpletest/tests/cache.test
@@ -146,15 +146,30 @@ class CacheSavingCase extends CacheTestCase {
     $test_object->test2 = 100;
     $test_object->test3 = array('drupal1', 'drupal2' => 'drupal3', 'drupal4' => array('drupal5', 'drupal6'));
 
-
     cache()->set('test_object', $test_object);
     $cached = cache()->get('test_object');
     $this->assertTrue(isset($cached->data) && $cached->data == $test_object, t('Object is saved and restored properly.'));
   }
 
+  /**
+   * Test the saving of multiple objects.
+   */
+  function testSetMultiple() {
+    cache()->set('cid_1', 'Some other value');
+    $items = array(
+      'cid_1' => array('data' => 1),
+      'cid_2' => array('data' => 2),
+    );
+    cache()->setMultiple($items);
+    $cids = array_keys($items);
+    $cached = cache()->getMultiple($cids);
+    $this->assertEqual($cached['cid_1']->data, $items['cid_1']['data'], t('Over-written cache item set correctly.'));
+    $this->assertEqual($cached['cid_2']->data, $items['cid_2']['data'], t('New cache item set correctly.'));
+  }
+
   /*
    * Check or a variable is stored and restored properly.
-   **/
+   */
   function checkVariable($var) {
     cache()->set('test_var', $var);
     $cached = cache()->get('test_var');
