Fix miscaching of homepage
Add system.getHostname() and system.getAppVersion() to the homepage
key so that we do not use an wrong version.
--- a/app/soc/cache/home.py Mon Sep 07 20:06:27 2009 +0200
+++ b/app/soc/cache/home.py Mon Sep 07 20:07:58 2009 +0200
@@ -27,6 +27,7 @@
from google.appengine.api import memcache
from soc.logic import accounts
+from soc.logic import system
import soc.cache.base
@@ -35,7 +36,12 @@
"""Returns the memcache key for an entities homepage.
"""
- return 'homepage_for_%s_%s' % (entity.kind(), entity.key().id_or_name())
+ host = system.getHostname()
+ version = system.getAppVersion()
+ kind = entity.kind()
+ key = entity.key().id_or_name()
+
+ return 'homepage_for_%s_%s_%s_%s' % (host, version, kind, key)
def get(self, *args, **kwargs):