diff --git a/common/djangoapps/cache_toolbox/core.py b/common/djangoapps/cache_toolbox/core.py index 3321f83d5e..a0a512ca68 100644 --- a/common/djangoapps/cache_toolbox/core.py +++ b/common/djangoapps/cache_toolbox/core.py @@ -118,4 +118,9 @@ def get_cached_content(location): def del_cached_content(location): - cache.delete(unicode(location).encode("utf-8")) + # delete content for the given location, as well as for content with run=None. + # it's possible that the content could have been cached without knowing the + # course_key - and so without having the run. + cache.delete_many( + [unicode(loc).encode("utf-8") for loc in [location, location.replace(run=None)]] + )