try using rack cache for in memory caching

This commit is contained in:
Sven Fuchs 2012-10-11 18:42:44 +02:00
parent b35763baa3
commit 86ab67feb2
3 changed files with 6 additions and 0 deletions

View File

@ -8,6 +8,7 @@ gem 'sinatra-contrib'
gem 'yard-sinatra', github: 'rkh/yard-sinatra'
gem 'rack-contrib', github: 'rack/rack-contrib'
gem 'rack-ssl', '~> 1.3'
gem 'rack-cache'
group :development, :test do
gem 'rake', '~> 0.9.2'

View File

@ -291,6 +291,7 @@ DEPENDENCIES
mocha (~> 0.12)
newrelic_rpm (~> 3.3.0)
pg (~> 0.13.2)
rack-cache
rack-contrib!
rack-ssl (~> 1.3)
rake (~> 0.9.2)

View File

@ -1,5 +1,6 @@
require 'rack'
require 'rack/protection/path_traversal'
require 'rack/cache'
class Travis::Web::App
ASSET_DIRS = %r(/(styles|scripts)/)
@ -31,7 +32,10 @@ class Travis::Web::App
use Rack::Protection::PathTraversal
use Travis::Web::App::Api, config if config.run_api?
use Rack::Cache, verbose: true, metastore: 'heap:/', entitystore: 'heap:/' if config.production?
use Rack::Deflater if config.deflate?
use Travis::Web::App::Assets, config
use Travis::Web::App::Filter, config
run Travis::Web::App::Files.new