Skip to content
This repository has been archived by the owner on Aug 18, 2024. It is now read-only.

Remove static cache in OgAccess::userAccess() #654

Closed
pfrenssen opened this issue Jul 7, 2020 · 0 comments · Fixed by #655
Closed

Remove static cache in OgAccess::userAccess() #654

pfrenssen opened this issue Jul 7, 2020 · 0 comments · Fixed by #655

Comments

@pfrenssen
Copy link
Contributor

We currently have a static cache in OgAccess::userAccess() which adds some considerable complexity but does not seem to be needed. All of the external methods that we are calling that do database queries already have static caches. The only part that is not covered is the alter hook, but it is not our responsibility to provide a caching layer for expensive logic that happens inside an alter hook.

I did some digging and it turns out this was added back in 2009 (ref commit 9e8e1e5590) to cache the results from user_role_permissions(). Even back then it was not needed, since user_role_permissions() has its own static cache, right from when it was initially added back in 2008 (ref issue #73874).

So it seems this static cache has never served any useful purpose in the whole history of OG. Let's remove it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants