Sha256: 5b2763947fb432055871dc147b2a08a595a8ae0b1ddf7c2601157255d6c58cbe

Contents?: true

Size: 1.4 KB

Versions: 2

Compression:

Stored size: 1.4 KB

Contents

= memcache-client

Rubyforge Project:

http://rubyforge.org/projects/rctools/

== About

memcache-client is a fast memcached client.

== Installing memcache-client

Just install the gem

  $ sudo gem install memcache-client

== Using memcache-client

  CACHE = MemCache.new :c_threshold => 10_000,
                       :compression => true,
                       :debug => false,
                       :namespace => 'my_namespace',
                       :readonly => false,
                       :urlencode => false
  CACHE.servers = 'localhost:11211'

You can specify multiple servers by sending an Array of servers to #servers=.

=== Using memcache-client with Rails

Rails will automatically load the memcache-client gem, but you may wish to
uninstall Ruby-memcache, I don't know which one it will pick by default.

Add your environment-specific caches to config/environment/*.  If you run both
development and production on the same machine be sure to use different
namespaces.  Be careful when running tests under memcache, you may get strange
results, it will be less of a headache to simply use a readonly memcache when
testing.

memcache-client also comes with a wrapper called Cache in memcache_util.rb for
use with Rails.  To use it be sure to assign your memcache connection to
CACHE.  Cache returns nil on all memcache errors so you don't have to rescue
yourself.  It has #get, #put and #delete module functions.

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
memcache-client-1.0.3 README
memcache-client-1.1.0 README.txt