diff --git README.txt README.txt
index f9fba23..8c1ed68 100644
--- README.txt
+++ README.txt
@@ -277,10 +277,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'
+);
+
 ## MAXIMUM LENGTHS ##
 
 If the length of your prefix + key + bin combine to be more than 250 characters,
diff --git dmemcache.inc dmemcache.inc
index b19c9c2..58fd006 100644
--- dmemcache.inc
+++ dmemcache.inc
@@ -853,8 +853,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.
