Skip to content

Commit

Permalink
MDL-71899 performance: Improve course image caching
Browse files Browse the repository at this point in the history
Changed to use get_course() instead of get_fast_modinfo() for better performance
  • Loading branch information
HuongNV13 committed Sep 9, 2021
1 parent 7fdf72a commit 604d58f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion course/classes/cache/course_image.php
Expand Up @@ -56,7 +56,8 @@ public static function get_instance_for_cache(cache_definition $definition): cou
* @return string|bool Returns course image url as a string or false if the image is not exist
*/
public function load_for_cache($key) {
$course = get_fast_modinfo($key)->get_course();
// We should use get_course() instead of get_fast_modinfo() for better performance.
$course = get_course($key);
return $this->get_image_url_from_overview_files($course);
}

Expand Down

0 comments on commit 604d58f

Please sign in to comment.