Quoting Yani Yen <[email protected]>:
> After reading through a lot of blogs, everyone seems to say that 
> memcache-client seems to be faster and better.
> 
> I installed memcache-client-1.8.5.gem
> 
> And my configuration in environment.rb file is:
> 
> memcache_options = {
>    :compression => true,
>    :debug => false,
>    :namespace => "mem-#{RAILS_ENV}",
>    :readonly => false,
>    :urlencode => false
> }
> 
> memcache_servers = [ '127.0.0.1:11211' ]
> 
> CACHE = MemCache.new(memcache_options)
> CACHE.servers = memcache_servers
>

In my application, all I do is add the following line to
conf/environments/production.rb and restart the server: 

config.cache_store = :mem_cache_store

I only cache in production, caching in development is too error prone, I
change something and am getting the incorrect cached result instead of the new
corrected result.
 
The host and port defaults to 127.0.0.1:11211.  Start here, when that works,
get fancier, e.g.:

config.cache_store = :mem_cache_store, '127.0.0.1:11211', { 
  :compression => true,
  :debug => false,
  :namespace => "mem-#{RAILS_ENV}",
  :readonly => false,
  :urlencode => false
}


HTH,
  Jeffrey

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to