Set timeouts for our memcached caches.

The policy this implements is:
* 1 week for most persistent data (Clients, etc.)
* 1 day for messages

(imported from commit d57bb2c6b9626ffa2155c6d0ef9b60827d1f2381)
This commit is contained in:
Tim Abbott
2013-03-26 14:09:45 -04:00
parent e2d010ef2d
commit e8aa77c9b4
5 changed files with 15 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ MESSAGE_CACHE_SIZE = 25000
def cache_save_message(message):
djcache.set(message_cache_key(message.id), (message,), timeout=3600*24)
@cache_with_key(message_cache_key)
@cache_with_key(message_cache_key, timeout=3600*24)
def cache_get_message(message_id):
return Message.objects.select_related().get(id=message_id)