Fix miscaching of homepage
authorSverre Rabbelier <srabbelier@gmail.com>
Mon, 07 Sep 2009 20:07:58 +0200
changeset 2869 1ac6a1e1e429
parent 2867 e8d86272e6ea
child 2871 e440e94a874b
Fix miscaching of homepage Add system.getHostname() and system.getAppVersion() to the homepage key so that we do not use an wrong version.
app/soc/cache/home.py
--- 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):