{"action":"created","issue":{"url":"https://api.github.com/repos/opf/openproject/issues/3553","labels_url":"https://api.github.com/repos/opf/openproject/issues/3553/labels{/name}","comments_url":"https://api.github.com/repos/opf/openproject/issues/3553/comments","events_url":"https://api.github.com/repos/opf/openproject/issues/3553/events","html_url":"https://github.com/opf/openproject/pull/3553","id":108006078,"number":3553,"title":"Experiment with angular-cache","user":{"login":"oliverguenther","id":459462,"avatar_url":"https://avatars.githubusercontent.com/u/459462?v=3","gravatar_id":"","url":"https://api.github.com/users/oliverguenther","html_url":"https://github.com/oliverguenther","followers_url":"https://api.github.com/users/oliverguenther/followers","following_url":"https://api.github.com/users/oliverguenther/following{/other_user}","gists_url":"https://api.github.com/users/oliverguenther/gists{/gist_id}","starred_url":"https://api.github.com/users/oliverguenther/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oliverguenther/subscriptions","organizations_url":"https://api.github.com/users/oliverguenther/orgs","repos_url":"https://api.github.com/users/oliverguenther/repos","events_url":"https://api.github.com/users/oliverguenther/events{/privacy}","received_events_url":"https://api.github.com/users/oliverguenther/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-23T21:05:42Z","updated_at":"2015-09-23T21:05:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/opf/openproject/pulls/3553","html_url":"https://github.com/opf/openproject/pull/3553","diff_url":"https://github.com/opf/openproject/pull/3553.diff","patch_url":"https://github.com/opf/openproject/pull/3553.patch"},"body":"This PR introduced a memory/sessionStorage cache using `angular-cache`. While angular has its own `$cacheFactory`, its options are rather limited and provide no integration with, e.g., the local and sessionStorage.\r\n\r\nOne prominent example where we should employ frontend-side caching\r\nis the fetching of associated users in activities, which is the main driver for this PR.\r\n\r\nFor a large number of comments of the same user, that user is retrieved\r\nonce per activity, which causes a drastic overhead.\r\n\r\nThis commit introduces a simple wrapper around angular-cache to store\r\nvalues in the sessionStorage.\r\n\r\n\r\n### TODOS / Open questions\r\n\r\n* [ ] Multiple cache stores (e.g., one for persistence / seldomly-changed values in localStorage)\r\n* [ ] Storing the promise in sessionStorage feels like magic, as I think some browsers limit the storage to string only. We should keep these things in memory, perhaps."},"comment":{"url":"https://api.github.com/repos/opf/openproject/issues/comments/142727931","html_url":"https://github.com/opf/openproject/pull/3553#issuecomment-142727931","issue_url":"https://api.github.com/repos/opf/openproject/issues/3553","id":142727931,"user":{"login":"TeatroIO","id":7524941,"avatar_url":"https://avatars.githubusercontent.com/u/7524941?v=3","gravatar_id":"","url":"https://api.github.com/users/TeatroIO","html_url":"https://github.com/TeatroIO","followers_url":"https://api.github.com/users/TeatroIO/followers","following_url":"https://api.github.com/users/TeatroIO/following{/other_user}","gists_url":"https://api.github.com/users/TeatroIO/gists{/gist_id}","starred_url":"https://api.github.com/users/TeatroIO/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TeatroIO/subscriptions","organizations_url":"https://api.github.com/users/TeatroIO/orgs","repos_url":"https://api.github.com/users/TeatroIO/repos","events_url":"https://api.github.com/users/TeatroIO/events{/privacy}","received_events_url":"https://api.github.com/users/TeatroIO/received_events","type":"User","site_admin":false},"created_at":"2015-09-23T21:05:43Z","updated_at":"2015-09-23T21:05:43Z","body":"I've prepared a stage to preview changes. <a href='http://oliverguenther-feature-angular-cache.opf-openproject-2af22bf12c7dfdad4ddf.ttrcloud.com' target='_blank'>Open stage</a> or <a href='http://oliverguenther-feature-angular-cache.opf-openproject-2af22bf12c7dfdad4ddf.ttrcloud.com/teatro.log' target='_blank'>view logs</a>."}}