From b8b4df5425e25403e77b108333faa2251b1348b3 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 9 Jan 2015 18:31:39 +0100 Subject: Cache responses from the AppStore server Otherwise every time the AppStore was opened a lot of connections to the AppStore server were made which resulted in a terrible performance. This changeset will cache the response for a sensible time so that only the first request will be somewhat slow. Performance changes: - Loading a category took previously more than 3 seconds on my machine. Now for every follow-up request it takes less than 200ms, resulting in a performance gain of 1950% - Loading the category list took previously about 750ms - now it takes 154ms, a total performance gain of 395% --- settings/ajax/installapp.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'settings/ajax/installapp.php') diff --git a/settings/ajax/installapp.php b/settings/ajax/installapp.php index 80bc1819724..f25e68214a7 100644 --- a/settings/ajax/installapp.php +++ b/settings/ajax/installapp.php @@ -12,6 +12,9 @@ $appId = OC_App::cleanAppId($appId); $result = OC_App::installApp($appId); if($result !== false) { + // FIXME: Clear the cache - move that into some sane helper method + \OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-0'); + \OC::$server->getMemCacheFactory()->create('settings')->remove('listApps-1'); OC_JSON::success(array('data' => array('appid' => $appId))); } else { $l = \OC::$server->getL10N('settings'); -- cgit v1.2.3