arthurnn / memcached

A Ruby interface to the libmemcached C client
Academic Free License v3.0
432 stars 125 forks source link

Use with Rails' config.assets.cache_store? #135

Closed scarver2 closed 11 years ago

scarver2 commented 11 years ago

Is your gem supported as a config.assets.cache_store mechanism as demonstrated here: http://blog.alexmaccaw.com/faster-deploys

http://edgeguides.rubyonrails.org/asset_pipeline.html#assets-cache-store

evan commented 11 years ago

I think so, since memcached/rails conforms to the Rails caching interface. I don't know how to configure it though.

scarver2 commented 11 years ago

Evan, I think I figured out how to configure Memcached gem to work with assets cache_store. It does speed up the compilation. Here are my settings using Garantia's Memcached Cloud with pipelining. Garantia does not currently (July 2013) support binary protocol so I had to turn that off.

# in config/environments/production.rb
config.assets.cache_store = Memcached::Rails.new(servers: ['cache-1.example.com', 'cache-2.example.com'], no_block: true, buffer_requests: true, noreply: true, binary_protocol: false)
evan commented 11 years ago

Nice!