diff --git a/lib/files/cache/cache.php b/lib/files/cache/cache.php
index 9d13b56104de7487f1e461effefe736d0a67abf6..dba026a611ee509c261c932bbb4f5f3e4d851de7 100644
--- a/lib/files/cache/cache.php
+++ b/lib/files/cache/cache.php
@@ -19,24 +19,25 @@ class Cache {
 	const SHALLOW = 2; //folder in cache, but not all child files are completely scanned
 	const COMPLETE = 3;
 
-	/**
-	 * @var \OC\Files\Storage\Storage
-	 */
-	private $storage;
-
 	/**
 	 * @var array partial data for the cache
 	 */
 	private $partial = array();
 
+	/**
+	 * @var string
+	 */
 	private $storageId;
 
 	/**
-	 * @param \OC\Files\Storage\Storage $storage
+	 * @param \OC\Files\Storage\Storage|string $storage
 	 */
-	public function __construct(\OC\Files\Storage\Storage $storage) {
-		$this->storage = $storage;
-		$this->storageId = $storage->getId();
+	public function __construct($storage) {
+		if($storage instanceof \OC\Files\Storage\Storage){
+			$this->storageId = $storage->getId();
+		}else{
+			$this->storageId = $storage;
+		}
 	}
 
 	/**