Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache role names in course #13

Open
abias opened this issue Nov 30, 2021 · 0 comments
Open

Cache role names in course #13

abias opened this issue Nov 30, 2021 · 0 comments

Comments

@abias
Copy link
Member

abias commented Nov 30, 2021

On https://github.com/moodleuulm/moodle-block_people/blob/master/block_people.php#L121, the plugin fetches the role names everytime the block is displayed.
However, role_get_names() always triggers DB queries and does not cache the role list.

It would be worthwhile to implement a cache within the plugin which caches the role list per course and invalidate it in the case if a) the admin changes the plugin configuration and wants to display other roles or b) if the roles get renamed globally or c) if the role names are overwritten in the course settings.

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

No branches or pull requests

1 participant