{"action":"created","issue":{"url":"https://api.github.com/repos/owncloud/core/issues/17080","labels_url":"https://api.github.com/repos/owncloud/core/issues/17080/labels{/name}","comments_url":"https://api.github.com/repos/owncloud/core/issues/17080/comments","events_url":"https://api.github.com/repos/owncloud/core/issues/17080/events","html_url":"https://github.com/owncloud/core/issues/17080","id":90093355,"number":17080,"title":"Cache folder content instead of getting it from the server every time","user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/owncloud/core/labels/app:files","name":"app:files","color":"02d7e1"},{"url":"https://api.github.com/repos/owncloud/core/labels/design","name":"design","color":"cc317c"},{"url":"https://api.github.com/repos/owncloud/core/labels/enhancement%20-%20proposed","name":"enhancement - proposed","color":"FF9900"},{"url":"https://api.github.com/repos/owncloud/core/labels/performance","name":"performance","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/owncloud/core/milestones/11","html_url":"https://github.com/owncloud/core/milestones/backlog","labels_url":"https://api.github.com/repos/owncloud/core/milestones/11/labels","id":697149,"number":11,"title":"backlog","description":"","creator":{"login":"MTRichards","id":1818977,"avatar_url":"https://avatars.githubusercontent.com/u/1818977?v=3","gravatar_id":"","url":"https://api.github.com/users/MTRichards","html_url":"https://github.com/MTRichards","followers_url":"https://api.github.com/users/MTRichards/followers","following_url":"https://api.github.com/users/MTRichards/following{/other_user}","gists_url":"https://api.github.com/users/MTRichards/gists{/gist_id}","starred_url":"https://api.github.com/users/MTRichards/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MTRichards/subscriptions","organizations_url":"https://api.github.com/users/MTRichards/orgs","repos_url":"https://api.github.com/users/MTRichards/repos","events_url":"https://api.github.com/users/MTRichards/events{/privacy}","received_events_url":"https://api.github.com/users/MTRichards/received_events","type":"User","site_admin":false},"open_issues":619,"closed_issues":2,"state":"open","created_at":"2014-06-20T19:52:03Z","updated_at":"2015-06-26T09:22:30Z","due_on":null,"closed_at":null},"comments":12,"created_at":"2015-06-22T13:07:12Z","updated_at":"2015-06-27T12:47:36Z","closed_at":null,"body":"Every time we enter a folder, a request is made to `apps/files/ajax/list.php` in order to get data to build the view.\r\nIt can take between 100ms and 500ms to get that information (on top of the time it takes to connect) on a fast server, depending on the folder's content. Probably much more on a Raspberry.\r\n\r\nIt turns out that even a 100ms delay is noticeable when you do a A/B comparison.\r\n\r\nI propose the following change:\r\n* cache the data structures which are built after receiving fresh data. It might not be possible to cache everything because of the memory it would require I guess.\r\n* send the folder's etag to `list.php`\r\n* the server returns an empty files array if the etag is the same as the current one\r\n* the client uses either the cache or the fresh data, depending on if there's been an etag change or not\r\n\r\nLetting the Files experts decide if that's feasible and worth it\r\n@schiesbn @PVince81 @butonic @LukasReschke @icewind1991 @DeepDiver1975 "},"comment":{"url":"https://api.github.com/repos/owncloud/core/issues/comments/116039454","html_url":"https://github.com/owncloud/core/issues/17080#issuecomment-116039454","issue_url":"https://api.github.com/repos/owncloud/core/issues/17080","id":116039454,"user":{"login":"oparoz","id":323220,"avatar_url":"https://avatars.githubusercontent.com/u/323220?v=3","gravatar_id":"","url":"https://api.github.com/users/oparoz","html_url":"https://github.com/oparoz","followers_url":"https://api.github.com/users/oparoz/followers","following_url":"https://api.github.com/users/oparoz/following{/other_user}","gists_url":"https://api.github.com/users/oparoz/gists{/gist_id}","starred_url":"https://api.github.com/users/oparoz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oparoz/subscriptions","organizations_url":"https://api.github.com/users/oparoz/orgs","repos_url":"https://api.github.com/users/oparoz/repos","events_url":"https://api.github.com/users/oparoz/events{/privacy}","received_events_url":"https://api.github.com/users/oparoz/received_events","type":"User","site_admin":false},"created_at":"2015-06-27T12:47:36Z","updated_at":"2015-06-27T12:47:36Z","body":"@ckruetze - That only works if you're able to insert new elements without having to do a full refresh. Not sure Files is capable of doing that yet.\r\n\r\nFor Gallery, I intend on using Redis to keep the cache constantly updated. That way, every time you make a request, you know if your cache is valid or not and when the view is idling, you can show a notification letting the user know he should click on the refresh button."}}