diff --git a/lib/memcache/apc.php b/lib/memcache/apc.php
index b3bb68223b49573ae564a9b25f7694c4445daf0b..575ee4427db6d5773466ec573e906026fcc3f740 100644
--- a/lib/memcache/apc.php
+++ b/lib/memcache/apc.php
@@ -9,15 +9,6 @@
 namespace OC\Memcache;
 
 class APC extends Cache {
-	protected $prefix;
-
-	public function __construct($global = false) {
-		$this->prefix = \OC_Util::getInstanceId() . '/';
-		if (!$global) {
-			$this->prefix .= \OC_User::getUser() . '/';
-		}
-	}
-
 	/**
 	 * entries in APC gets namespaced to prevent collisions between owncloud instances and users
 	 */
@@ -61,7 +52,7 @@ class APC extends Cache {
 			return false;
 		} elseif (!ini_get('apc.enable_cli') && \OC::$CLI) {
 			return false;
-		}else{
+		} else {
 			return true;
 		}
 	}
diff --git a/lib/memcache/cache.php b/lib/memcache/cache.php
index b9e0c2249ac4580cf1e62bad13ba2926923cc04c..9db69ae410453c84297c379f43b4500bf01933c8 100644
--- a/lib/memcache/cache.php
+++ b/lib/memcache/cache.php
@@ -9,12 +9,21 @@
 namespace OC\Memcache;
 
 abstract class Cache {
-
+	/**
+	 * @var string $prefix
+	 */
+	protected $prefix;
 
 	/**
-	 * @param bool $global
+	 * @param string $prefix
 	 */
-	abstract public function __construct($global);
+	public function __construct($prefix = '') {
+		$this->prefix = \OC_Util::getInstanceId() . '/' . $prefix;
+	}
+
+	public function getPrefix() {
+		return $this->prefix;
+	}
 
 	/**
 	 * @param string $key
diff --git a/lib/memcache/memcached.php b/lib/memcache/memcached.php
index ab35bd8bbaca9ba7a26deb02ce23a44995b77058..978e6c2eff12b398beead40859e2eb87a2367e10 100644
--- a/lib/memcache/memcached.php
+++ b/lib/memcache/memcached.php
@@ -9,18 +9,13 @@
 namespace OC\Memcache;
 
 class Memcached extends Cache {
-	protected $prefix;
-
 	/**
 	 * @var \Memcached $cache
 	 */
 	private static $cache = null;
 
-	public function __construct($global = false) {
-		$this->prefix = \OC_Util::getInstanceId() . '/';
-		if (!$global) {
-			$this->prefix .= \OC_User::getUser() . '/';
-		}
+	public function __construct($prefix = '') {
+		parent::__construct($prefix);
 		if (is_null(self::$cache)) {
 			self::$cache = new \Memcached();
 			list($host, $port) = \OC_Config::getValue('memcached_server', array('localhost', 11211));
diff --git a/lib/memcache/xcache.php b/lib/memcache/xcache.php
index 0ee34c667d3de606e1d721492fcac82313db2622..33de30562f901e7bbaef111cc823f70db700ec95 100644
--- a/lib/memcache/xcache.php
+++ b/lib/memcache/xcache.php
@@ -9,15 +9,6 @@
 namespace OC\Memcache;
 
 class XCache extends Cache {
-	protected $prefix;
-
-	public function __construct($global = false) {
-		$this->prefix = \OC_Util::getInstanceId().'/';
-		if (!$global) {
-			$this->prefix .= \OC_User::getUser().'/';
-		}
-	}
-
 	/**
 	 * entries in XCache gets namespaced to prevent collisions between owncloud instances and users
 	 */