aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-11-19 16:24:23 +0000
committerLouise Crow <louise.crow@gmail.com>2013-11-25 16:31:19 +0000
commit7b8978560a193e958fe601af1a32ab7a7f40fde9 (patch)
treeceffbe1f38ebc7fccfe369bba373854230001de9
parentcdc0c7d342d99d2c5dc52747b1bf1111028be9d4 (diff)
Set cache store to memcached, turn off rack-cache.
The rack-cache gem version used by Rails (and turned on by default in 3.1) has a bug using memcached backend and the backend is unavailable. Note that we could just add the git version with the relevant pull request merged to the Gemfile if we wanted to keep rake-cache on, but it seems like Varnish should really be doing the job of whole page caching better for us.
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock2
-rw-r--r--config/application.rb4
-rw-r--r--config/packages1
4 files changed, 8 insertions, 0 deletions
diff --git a/Gemfile b/Gemfile
index 186251de4..5cb705a07 100644
--- a/Gemfile
+++ b/Gemfile
@@ -20,6 +20,7 @@ gem 'fastercsv', '>=1.5.5'
gem 'jquery-rails', '~> 2.1'
gem 'json'
gem 'mahoro'
+gem 'memcache-client'
gem 'net-http-local'
gem 'net-purge'
gem 'newrelic_rpm'
diff --git a/Gemfile.lock b/Gemfile.lock
index 989920a72..53f77e1e3 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -125,6 +125,7 @@ GEM
skinny (~> 0.2.3)
sqlite3 (~> 1.3)
thin (~> 1.5.0)
+ memcache-client (1.8.5)
mime-types (1.23)
multi_json (1.7.4)
net-http-local (0.1.2)
@@ -273,6 +274,7 @@ DEPENDENCIES
locale
mahoro
mailcatcher
+ memcache-client
net-http-local
net-purge
newrelic_rpm
diff --git a/config/application.rb b/config/application.rb
index ad5d4b03f..245a60782 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -55,6 +55,10 @@ module Alaveteli
# will be in this time zone
config.time_zone = ::AlaveteliConfiguration::time_zone
+ # Set the cache to use a memcached backend
+ config.cache_store = :mem_cache_store, { :namespace => AlaveteliConfiguration::domain }
+ config.action_dispatch.rack_cache = nil
+
config.after_initialize do |app|
require 'routing_filters.rb'
# Add a catch-all route to force routing errors to be handled by the application,
diff --git a/config/packages b/config/packages
index 8bb00a849..9a07c5f20 100644
--- a/config/packages
+++ b/config/packages
@@ -38,3 +38,4 @@ bundler
sqlite3
libsqlite3-dev
libicu-dev
+memcached