[PERF-344] Add versioning of cached course assets to allow graceful cache invalidation
When releasing the versioned assets work, we stumbled on a problem with old pickled versions of the StaticContent objects residing in cache, which triggered a bug in the code. Not wanting to blow away all cached items, we ended up having to revert and add in some backwards-compatible helper code to ease the transition. With this, we'll now utilize the version argument that Django's caching interface allows, in conjunction with a constant value that can be modified when breaking changes are being made, to let us gracefully ignore older cached course assets.
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
from cache_toolbox.core import get_cached_content, set_cached_content, del_cached_content
|
||||
"""
|
||||
Tests core caching facilities.
|
||||
"""
|
||||
from contentserver.caching import get_cached_content, set_cached_content, del_cached_content
|
||||
from opaque_keys.edx.locations import Location
|
||||
from django.test import TestCase
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ from django.views.decorators.http import require_http_methods, require_POST
|
||||
from django.conf import settings
|
||||
|
||||
from edxmako.shortcuts import render_to_response
|
||||
from cache_toolbox.core import del_cached_content
|
||||
from contentserver.caching import del_cached_content
|
||||
|
||||
from contentstore.utils import reverse_course_url
|
||||
from xmodule.contentstore.django import contentstore
|
||||
|
||||
@@ -13,7 +13,7 @@ from django.test.utils import override_settings
|
||||
from django.conf import settings
|
||||
|
||||
from contentstore.tests.utils import CourseTestCase, mock_requests_get
|
||||
from cache_toolbox.core import del_cached_content
|
||||
from contentserver.caching import del_cached_content
|
||||
from xmodule.modulestore.django import modulestore
|
||||
from xmodule.contentstore.django import contentstore
|
||||
from xmodule.contentstore.content import StaticContent
|
||||
|
||||
Reference in New Issue
Block a user