turn on memcached
authorRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 22 Feb 2011 11:42:47 +0000 (12:42 +0100)
committerRadek Czajka <radoslaw.czajka@nowoczesnapolska.org.pl>
Tue, 22 Feb 2011 11:42:47 +0000 (12:42 +0100)
requirements.txt
wolnelektury/settings.py

index 0139514..cd1467f 100644 (file)
@@ -7,6 +7,8 @@ django-pagination>=1.0
 django-rosetta>=0.5.3
 django-maintenancemode>=0.9
 
+python-memcached
+
 # Feedparser 
 Feedparser>=4.1
 
index a50763d..e85f189 100644 (file)
@@ -91,14 +91,16 @@ TEMPLATE_CONTEXT_PROCESSORS = [
 ]
 
 MIDDLEWARE_CLASSES = [
+    'django.middleware.cache.UpdateCacheMiddleware',
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
     'django.middleware.doc.XViewMiddleware',
     'pagination.middleware.PaginationMiddleware',
     'django.middleware.locale.LocaleMiddleware',
-
     'maintenancemode.middleware.MaintenanceModeMiddleware',
+    'django.middleware.common.CommonMiddleware',
+    'django.middleware.cache.FetchFromCacheMiddleware',
 ]
 
 ROOT_URLCONF = 'wolnelektury.urls'
@@ -141,7 +143,9 @@ INSTALLED_APPS = [
     'pdcounter',
 ]
 
-CACHE_BACKEND = 'locmem:///?max_entries=3000'
+#CACHE_BACKEND = 'locmem:///?max_entries=3000'
+CACHE_BACKEND = 'memcached://127.0.0.1:11211/'
+CACHE_MIDDLEWARE_ANONYMOUS_ONLY=True
 
 # CSS and JavaScript file groups
 COMPRESS_CSS = {