Created
August 12, 2009 07:12
-
-
Save wezm/166357 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'rack/cache' | |
infinity = Proc.new do |env| | |
# env['HTTP_CACHE_CONTROL'] = 'max-age=60' | |
[200, {"Content-Type" => "text/plain", 'Cache-Control' => 'max-age=60'}, env.inspect] | |
end | |
use Rack::CommonLogger | |
use Rack::Cache, | |
:verbose => true, | |
:metastore => 'file:/tmp/cache-test-m', | |
:entitystore => 'file:/tmp/cache-text-e' | |
map '/' do | |
run infinity | |
end | |
map '/version' do | |
map '/' do | |
run Proc.new {|env| [200, {"Content-Type" => "text/plain"}, "infinity 0.1"] } | |
end | |
map '/last' do | |
run Proc.new {|env| [200, {"Content-Type" => "text/plain"}, "infinity beta 0.0"] } | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rackup -s mongrel infinity.ru |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment