From 39a7c095127a1b1fa600ae28bed93476c9de1280 Mon Sep 17 00:00:00 2001 From: David Ormsbee Date: Thu, 27 Jul 2017 11:13:00 -0400 Subject: [PATCH] Re-add to BlockStructure cache on miss. BlockStructures are stored in S3, but they're cached in memcached. Prior to this commit, they were only written to memcached when first created. This commit adds a write to repopulate the cache entry every time there is a cache miss. Hopefully, this will help reduce the miss rate we're seeing. --- openedx/core/djangoapps/content/block_structure/store.py | 1 + 1 file changed, 1 insertion(+) diff --git a/openedx/core/djangoapps/content/block_structure/store.py b/openedx/core/djangoapps/content/block_structure/store.py index b6976046c4..7974a0d4f1 100644 --- a/openedx/core/djangoapps/content/block_structure/store.py +++ b/openedx/core/djangoapps/content/block_structure/store.py @@ -93,6 +93,7 @@ class BlockStructureStore(object): serialized_data = self._get_from_cache(bs_model) except BlockStructureNotFound: serialized_data = self._get_from_store(bs_model) + self._add_to_cache(serialized_data, bs_model) return self._deserialize(serialized_data, root_block_usage_key)