This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| name | age | message | |
|---|---|---|---|
| |
README.textile | Wed Jun 24 00:28:55 -0700 2009 | |
| |
Rakefile | Wed Jun 24 00:28:55 -0700 2009 | |
| |
lib/ | Wed Jun 17 23:38:41 -0700 2009 | |
| |
sinatra-memcache.gemspec | Wed Jun 24 00:30:43 -0700 2009 | |
| |
spec/ | Wed Jun 24 00:28:55 -0700 2009 |
README.textile
Sinatra-MemCache
Dependencies
memcache-client
zlib
Install
sudo gem install gioext-sinatra-memcache
Example
require 'rubygems'
require 'sinatra'
require 'sinatra/memcache'
# 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-memcache"
set :cache_enable, true
set :cache_logging, true
set :cache_default_expiry, 3600
set :cache_default_compress, false
License
Copyright © 2009 Kazuki UCHIDA
Licensed under the MIT License:
- http://www.opensource.org/licenses/mit-license.php







