diff --git a/README.txt b/README.txt
index 0a77f47..32e9839 100644
--- a/README.txt
+++ b/README.txt
@@ -243,10 +243,18 @@ go to 'cluster2'. All other bins go to 'default'.
 
 If you want to have multiple Drupal installations share memcached instances,
 you need to include a unique prefix for each Drupal installation in the $conf
-array of settings.php:
+array of settings.php. This can be a single string prefix, or a keyed array of
+bin => prefix pairs:
 
 $conf['memcache_key_prefix'] = 'something_unique';
 
+Using a per-bin prefix:
+
+$conf['memcache_key_prefix'] = array(
+  'default' => 'something_unique',
+  'cache_page' => 'something_else_unique'
+);
+
 Note: if the length of your prefix + key + bin combine to be more than 250
 characters, they will be automatically hashed. Memcache only supports key
 lengths up to 250 bytes. You can optionally configure the hashing algorithm
diff --git a/dmemcache.inc b/dmemcache.inc
index 1b73c2f..595caae 100644
--- a/dmemcache.inc
+++ b/dmemcache.inc
@@ -611,8 +611,18 @@ function dmemcache_object($bin = NULL, $flush = FALSE) {
  */
 function dmemcache_key($key, $bin = 'cache') {
   $prefix = '';
-  if ($prefix = variable_get('memcache_key_prefix', '')) {
-    $prefix .= '-';
+  if ($prefixes = variable_get('memcache_key_prefix', '')) {
+    if (is_array($prefixes)) {
+      if (!empty($prefixes[$bin])) {
+        $prefix = $prefixes[$bin] . '-';
+      } // Support default prefix for site
+      elseif (!empty($prefixes['default'])) {
+        $prefix = $prefixes['default'] . '-';
+      }
+    }
+    else {
+      $prefix = $prefixes . '-';
+    }
   }
   // When simpletest is running, emulate the simpletest database prefix here
   // to avoid the child site setting cache entries in the parent site.
