Commit 0037dad8 by Tyler Hallada Committed by GitHub

AN-8701 Increase course_summaries cache timeout to 1 hour (#663)

* Increase default cache timeout to 1 hour

* Only increase timeout for summaries.

Also sets local cache to a DummyCache.

* Revert local.py DummyCache setting

* Update api-client to 0.11.0

* Revert "Update api-client to 0.11.0"

This reverts commit e719968954b3b82c9eb0fe65cabcb8e501a633f6.

Accidentally committed to wrong branch.
parent dbdd09c1
from django.conf import settings
from django.core.cache import cache
from courses.presenters import BasePresenter
......@@ -28,7 +29,7 @@ class CourseSummariesPresenter(BasePresenter):
all_summaries = [
{field: ('' if val is None and field in self.NON_NULL_STRING_FIELDS else val)
for field, val in summary.items()} for summary in all_summaries]
cache.set(self.CACHE_KEY, all_summaries)
cache.set(self.CACHE_KEY, all_summaries, settings.COURSE_SUMMARIES_CACHE_TIMEOUT)
return all_summaries
def _get_last_updated(self, summaries):
......
......@@ -480,3 +480,7 @@ COURSE_ID_PATTERN = r'(?P<course_id>[^/+]+[/+][^/+]+[/+][^/]+)'
# Default (None) includes all available fields, in alphabetical order.
LEARNER_API_LIST_DOWNLOAD_FIELDS = None
########## END LEARNER_API_LIST_DOWNLOAD_FIELDS
########## CACHE CONFIGURATION
COURSE_SUMMARIES_CACHE_TIMEOUT = 3600 # 1 hour timeout
########## END CACHE CONFIGURATION
......@@ -20,7 +20,7 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache'
}
}
########## END CACHE CONFIGURATION
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment