Skip to content

Instantly share code, notes, and snippets.

@galderz
Created April 26, 2011 19:58
Show Gist options
  • Save galderz/942993 to your computer and use it in GitHub Desktop.
Save galderz/942993 to your computer and use it in GitHub Desktop.
require 'sinatra/base'
# require 'active_support/cache/torque_box_store'
require 'hotrod-jruby/remote_cache'
class SinatraHotRod < Sinatra::Base
set :cache, RemoteCache.new
get '/time' do
settings.cache.put "now", Time.now
end
get '/' do
"Hello world!\nCache contains:\n#{settings.cache.get("now")}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment