{"action":"created","issue":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/6053","repository_url":"https://api.github.com/repos/joomla/joomla-cms","labels_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6053/labels{/name}","comments_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6053/comments","events_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6053/events","html_url":"https://github.com/joomla/joomla-cms/pull/6053","id":57305462,"number":6053,"title":"Adding access cache to JUser","user":{"login":"Hackwar","id":313866,"avatar_url":"https://avatars.githubusercontent.com/u/313866?v=3","gravatar_id":"","url":"https://api.github.com/users/Hackwar","html_url":"https://github.com/Hackwar","followers_url":"https://api.github.com/users/Hackwar/followers","following_url":"https://api.github.com/users/Hackwar/following{/other_user}","gists_url":"https://api.github.com/users/Hackwar/gists{/gist_id}","starred_url":"https://api.github.com/users/Hackwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Hackwar/subscriptions","organizations_url":"https://api.github.com/users/Hackwar/orgs","repos_url":"https://api.github.com/users/Hackwar/repos","events_url":"https://api.github.com/users/Hackwar/events{/privacy}","received_events_url":"https://api.github.com/users/Hackwar/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/joomla/joomla-cms/labels/PR-staging","name":"PR-staging","color":"c7def8"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-11T11:40:41Z","updated_at":"2016-05-19T09:28:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/joomla/joomla-cms/pulls/6053","html_url":"https://github.com/joomla/joomla-cms/pull/6053","diff_url":"https://github.com/joomla/joomla-cms/pull/6053.diff","patch_url":"https://github.com/joomla/joomla-cms/pull/6053.patch"},"body":"This adds caching to the authorise method of JUser. Instead of doing the whole check each time JUser::authorise() is called, the checks are done once per session and that is it. This is quite a performance improvement.\r\n\r\nTo prevent the session from being overrun by the access cache, the number of access results to cache is limited to 250 entries. That should be equivalent to around 10-14kb of data.\r\n\r\nI did not make scientific tests with this, just some manual comparisons and I did get positive results in terms of performance gain.\r\n\r\nThere is a potential issue when an extension creates its own login/logout code that does not use JApplicationCMS::login/logout and which does not correctly reset the JUser object. In that case however, that extension has quite large security issues anyway. \r\n\r\nAnyway, I made the caching variable private, so that we can remove it again in case it turns out to be a failure. There is no backwards compatibility issue there."},"comment":{"url":"https://api.github.com/repos/joomla/joomla-cms/issues/comments/220273380","html_url":"https://github.com/joomla/joomla-cms/pull/6053#issuecomment-220273380","issue_url":"https://api.github.com/repos/joomla/joomla-cms/issues/6053","id":220273380,"user":{"login":"roland-d","id":359377,"avatar_url":"https://avatars.githubusercontent.com/u/359377?v=3","gravatar_id":"","url":"https://api.github.com/users/roland-d","html_url":"https://github.com/roland-d","followers_url":"https://api.github.com/users/roland-d/followers","following_url":"https://api.github.com/users/roland-d/following{/other_user}","gists_url":"https://api.github.com/users/roland-d/gists{/gist_id}","starred_url":"https://api.github.com/users/roland-d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roland-d/subscriptions","organizations_url":"https://api.github.com/users/roland-d/orgs","repos_url":"https://api.github.com/users/roland-d/repos","events_url":"https://api.github.com/users/roland-d/events{/privacy}","received_events_url":"https://api.github.com/users/roland-d/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T09:28:30Z","updated_at":"2016-05-19T09:28:30Z","body":"@Hackwar \r\nWhat are the test instructions to make sure this is properly tested?\r\n\r\nIf I am not mistaken this requires a user to logout and login again to get the correct permissions once it has been changed. How does this relate to the PR #8805? Does this have any effect on this PR?\r\n\r\n"}}