High performance memcached client for Ruby.
Questions tagged [dalli]
131 questions
80
votes
4 answers
Rails.cache.clear certain key names?
Is it possible to somehow run Rails.cache.clear and only clear keys with a certain name/string?
I don't want to clear the entire cache...just keys with the string blog/post in the name (ie. blog/post/1, blog/post/2).
I'm using dalli with memcached…

Shpigford
- 24,748
- 58
- 163
- 252
23
votes
6 answers
Rails + Dalli memcache gem: DalliError: No server available
Hi I'm having trouble setting up my Rails project on my server because apache keeps complaining
DalliError: No server available.
I installed memcached on my ubuntu machine, but it still doesn't work. My rails project also has config.cache_store =…

bigpotato
- 26,262
- 56
- 178
- 334
11
votes
1 answer
rails 4 use memcached as session store using dalli
I am not able to use memcached as session store with rails 4 using dalli gem.
Here's what I have done.
I added dalli gem to Gemfile
gem 'dalli'
I added the following line in…

Gagan
- 4,278
- 7
- 46
- 71
6
votes
1 answer
Are dalli gem's write operations asynchronous?
I want to use memcached for session store which is on a different server it will be accessed by rails app using dalli gem. So are dalli gem's write operations asynchronous? If not is it possible to make them async? As it shouldn't be the bottleneck…

Hardik
- 3,815
- 3
- 35
- 45
6
votes
2 answers
Rails memcache store default auto expiration time
I have been struggling for a while to find out if there is some default expiration time set by Rails, in case we don't provide any while storing a key-value pair to memcache?
e.g. Rails.cache.write('some-key', 'some-value')
Would rails set some…

user1954528
- 61
- 1
- 2
6
votes
4 answers
How do cache finding object by id
select * from Foo where id = 200
How to cache finding object by id, since we observe a select call being made all the time on a certain id. How should we enable this in rails in a non obtrusive fashion, so that we can switch between any cache store…

Joe
- 14,513
- 28
- 82
- 144
6
votes
1 answer
Change Rails cache_store at runtime?
My application has a feature that allows the administrator can change the cache_store configuration via a GUI. Then the new configuration will take effect right away.
The default cache_store in my production.rb:
config.cache_store =…

Blue Smith
- 8,580
- 2
- 28
- 33
5
votes
0 answers
List all cache items in remote servers with Dalli
I have been recently picking up more learnings with Memcached and how Dalli plays along with the different caching strategies. I am trying to connect remotely to our memcachier on heroku with one of our production level projects. Through some…

Chris Yeung
- 2,613
- 6
- 34
- 57
5
votes
0 answers
rails memcached cannot load such file -- dalli
I want to use memcached in Rails.
So I set in my local. Good. and deploy to my server.. a problem comes up
The problem is that dalli cannot be loaded in active_support/cache/mem_cache_store.rb..
My server environment :
ubuntu / nginx / unicorn /…

myggul
- 387
- 1
- 5
- 22
5
votes
2 answers
How to setup dalli cache in test environment?
I'm going to use Dalli cache as key-value store.
Usually in production and development environments we have line
config.cache_store = :dalli_store
so then we can use Rails.cache construction to read from and write to cache.
But in the test…

megas
- 21,401
- 12
- 79
- 130
5
votes
1 answer
Rails.cache.fetch inserting extra values
We have a page which shows the top groups for our application. The calculation of the leader board is expensive so we cache the results for an hour as follows:
@groupboard = Rails.cache.fetch("top_groups", :expires_in => 1.hour) do
…

Andy
- 1,801
- 3
- 22
- 33
5
votes
2 answers
How to delete a keys in memcached with regex (using Dalli+RoR).
How to delete a keys in memcached with regex (using Dalli+Rails)
def expire_all
expire_fragment(Regexp.new("/customers/customers"))
expire_fragment(Regexp.new("/customers/customers\/"))
…

Ilhom
- 144
- 3
- 12
4
votes
2 answers
How to delete a range of keys in memcached (using Dalli+RoR)
I am running Ruby on Rails and am using the Dalli gem to access memcached.
Question: how do I delete a range of keys (not multiple, but a range) for something like: delete all memcached entries with a key that begins with "USERINFO", in other words,…

KKK
- 1,085
- 11
- 33
4
votes
0 answers
Slow cache read on first cache fetch in Rails
I am seeing some very slow cache reads in my rails app. Both redis (redis-rails) and memcached (dalli) produced the same results.
It looks like it is only the first call to Rails.cache that causes the slowness (averaging 500ms).
I am using…

Trae Robrock
- 61
- 4
4
votes
9 answers
Rails Cache Key generated as ActiveRecord::Relation
I am attempting to generate a fragment cache (using a Dalli/Memcached store) however the key is being generated with "#" as part of the key, so Rails doesn't seem to be recognizing that there is a cache value and is hitting the database.
My cache…

cman77
- 1,753
- 1
- 22
- 48