diff mbox

[Branch,~linaro-validation/lava-server/trunk] Rev 213: Enable site-wide caching for anonymous users

Message ID 20110720203626.32572.39784.launchpad@loganberry.canonical.com
State Accepted
Headers show

Commit Message

Zygmunt Krynicki July 20, 2011, 8:36 p.m. UTC
------------------------------------------------------------
revno: 213
committer: Zygmunt Krynicki <zygmunt.krynicki@linaro.org>
branch nick: trunk
timestamp: Wed 2011-07-20 22:29:51 +0200
message:
  Enable site-wide caching for anonymous users
modified:
  lava_server/settings/common.py


--
lp:lava-server
https://code.launchpad.net/~linaro-validation/lava-server/trunk

You are subscribed to branch lp:lava-server.
To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-server/trunk/+edit-subscription
diff mbox

Patch

=== modified file 'lava_server/settings/common.py'
--- lava_server/settings/common.py	2011-07-13 10:59:13 +0000
+++ lava_server/settings/common.py	2011-07-20 20:29:51 +0000
@@ -57,7 +57,9 @@ 
     'django.middleware.csrf.CsrfViewMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
+    'django.middleware.cache.UpdateCacheMiddleware',
     'django.middleware.common.CommonMiddleware',
+    'django.middleware.cache.FetchFromCacheMiddleware',
     'django.middleware.transaction.TransactionMiddleware',
 ]
 
@@ -126,3 +128,8 @@ 
 # This is fixed in south 0.7.1, if we upgrade past that it's safe to
 # remove this line.
 SKIP_SOUTH_TESTS = True
+
+
+CACHE_BACKEND = "locmem://"
+CACHE_MIDDLEWARE_SECONDS = 60 * 60
+CACHE_MIDDLEWARE_ANONYMOUS_ONLY = True