try using rack/cache with memcached

This commit is contained in:
Sven Fuchs 2012-10-11 15:01:54 +02:00
parent 6231e1183c
commit 02f5eea4fc
3 changed files with 14 additions and 0 deletions

View File

@ -8,8 +8,10 @@ gem 'travis-core', github: 'travis-ci/travis-core', branch: 'sf-travis-api'
gem 'hubble', github: 'roidrage/hubble'
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
gem 'rack-contrib', github: 'rack/rack-contrib'
gem 'rack-cache', '~> 1.2'
gem 'gh', github: 'rkh/gh'
gem 'bunny'
gem 'dalli'
group :test do
gem 'rspec', '~> 2.11'

View File

@ -118,6 +118,7 @@ GEM
builder (3.0.3)
bunny (0.8.0)
daemons (1.1.9)
dalli (2.2.1)
data_migrations (0.0.1)
activerecord
rake
@ -235,6 +236,7 @@ PLATFORMS
DEPENDENCIES
bunny
dalli
database_cleaner (~> 0.8.0)
factory_girl (~> 2.4.0)
foreman
@ -242,6 +244,7 @@ DEPENDENCIES
hubble!
micro_migrations!
mocha (~> 0.12)
rack-cache (~> 1.2)
rack-contrib!
rake (~> 0.9.2)
rerun

View File

@ -3,6 +3,7 @@ require 'backports'
require 'rack'
require 'rack/protection'
require 'rack/contrib'
require 'rack/cache'
require 'active_record'
require 'redis'
require 'gh'
@ -55,6 +56,14 @@ module Travis::Api
use Hubble::Rescuer, env: Travis.env, codename: ENV['CODENAME'] if Endpoint.production? && ENV['HUBBLE_ENDPOINT']
use Rack::Protection::PathTraversal
use Rack::SSL if Endpoint.production?
if memcache_servers = ENV['MEMCACHE_SERVERS']
use Rack::Cache,
verbose: true,
metastore: "memcached://#{memcache_servers}",
entitystore: "memcached://#{memcache_servers}"
end
use Rack::Deflater
use Rack::PostBodyContentTypeParser
use Rack::JSONP