diff --git a/apps/files_sharing/lib/External/Storage.php b/apps/files_sharing/lib/External/Storage.php
index d07e0556685bf7bfa3b8b237d74c6eca39c783f8..bae24e89e642fc90a4efbdf5a3e95e27ee5c2f80 100644
--- a/apps/files_sharing/lib/External/Storage.php
+++ b/apps/files_sharing/lib/External/Storage.php
@@ -280,7 +280,7 @@ class Storage extends DAV implements ISharedStorage {
 			$returnValue = false;
 		}
 
-		$cache->set($url, $returnValue);
+		$cache->set($url, $returnValue, 60*60*24);
 		return $returnValue;
 	}
 
diff --git a/lib/private/OCS/DiscoveryService.php b/lib/private/OCS/DiscoveryService.php
index 35230b4cfd3fe58bdf14dd7c1c770a0674ac9bbb..e547747da259ad3f41c3359a2fa7063e937884e2 100644
--- a/lib/private/OCS/DiscoveryService.php
+++ b/lib/private/OCS/DiscoveryService.php
@@ -81,11 +81,10 @@ class DiscoveryService implements IDiscoveryService {
 			}
 		} catch (\Exception $e) {
 			// if we couldn't discover the service or any end-points we return a empty array
-			return [];
 		}
 
 		// Write into cache
-		$this->cache->set($remote . '#' . $service, json_encode($discoveredServices));
+		$this->cache->set($remote . '#' . $service, json_encode($discoveredServices), 60*60*24);
 		return $discoveredServices;
 	}