Skip to content

caseman72/sinatra-dalli

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sinatra-Dalli

Install

gem install sinatra-dalli

Dependencies

dalli
zlib

Usage:

require 'rubygems'
require 'sinatra'
require 'sinatra/dalli'

# cache
get '/cache1' do
  cache 'cache1' do
    sleep(5)
    'Hello Cache1'
  end
end

# args
get '/cache2' do
  cache 'cache2', :expiry => 10, :compress => true do
    sleep(3)
    'Hello Cache2'
  end
end

# cache object
get '/obj' do
  hash = cache 'obj' do
    sleep(2)
    { :a => 'Hello Object' }
  end
  hash[:a]
end

# expire
get '/expire' do
  expire 'cache1'
  expire /^cache/
  expire //
  'Hello Expire'
end

# default options
set :cache_server, "localhost:11211"
set :cache_namespace, "sinatra-dalli"
set :cache_enable, true
set :cache_logging, true
set :cache_default_expiry, 3600
set :cache_default_compress, false

Authors & Contributors

Kazuki Uchida, gioext@gmail.com

Casey Manion, casey@manion.com

License

Copyright (c) 2009 Kazuki UCHIDA

Licensed under the MIT License:

http://www.opensource.org/licenses/mit-license.php

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%