High performance memcached client for Ruby.
Questions tagged [dalli]
131 questions
1
vote
0 answers
check does memcached store mysql queries
Rails 3.2.18
memcached
dalli
I have added the line to production.rb
config.cache_store = :dalli_store, '127.0.0.1', {:namespace => 'production'}
And I want that mysql queries will be stored in memcached.
How can I checked that queries are…

Lesha Pipiev
- 3,251
- 4
- 31
- 65
1
vote
0 answers
How to extend Rails cache
I've tried adding new behaviour to Dalli, which is the cache store I'm using:
class ActiveSupport::Cache::DalliStore
def fetch(name, options = {})
if options[:cache]==false
yield
else
super(name, options) { yield }
end
…

mahemoff
- 44,526
- 36
- 160
- 222
1
vote
0 answers
Memcached (Dalli client) - possible memory leak? heroku?
I tried to implement low-level (model) caching in my app.
I am looking for help with dealing with possible memory leak.
Rails4
client: Dalli
cache store: Memcached Cloud
I have a 'users' index page where I load a lot of users and their data…

codeObserver
- 6,521
- 16
- 76
- 121
1
vote
1 answer
Why is the database still being hit even after memcached stores the result?
I am making a few basic queries with active record and attempting to store the result in memcached using the dalli gem.
I have the following code:
@page = Rails.cache.fetch 'pages/index' do
Page.find_by_name('index')
end
@grid_items =…

koosa
- 2,966
- 3
- 31
- 46
1
vote
1 answer
Dalli::DalliError: Response error 130: Out of memory
Dalli::DalliError: Response error 130: Out of memory
from /bundled_gems/ruby/1.9.1/gems/dalli-2.7.0/lib/dalli/server.rb:496:in cas_response' from /bundled_gems/ruby/1.9.1/gems/dalli-2.7.0/lib/dalli/server.rb:275:inblock in set'
from…

yednamus
- 582
- 1
- 4
- 22
1
vote
1 answer
Rspec: testing dalli cache (outside of rails)
This might be outside the realm of what you should test, but how could one test a service method that uses caching (i.e. that it uses the cache):
def get_payment_methods(country_code, filter=[])
key =…

kreek
- 8,774
- 8
- 44
- 69
1
vote
1 answer
How to get cache expiration date in Rails 3 using the Dalli gem?
I have a Rails 3 application that uses the Dalli gem to manage its cache.
I need to check if a certain part of the application is setting the expiration date of the cache correctly, but can't find a way to manually check that on a specific…

João de Paula
- 123
- 1
- 7
1
vote
1 answer
Serving images from public folder loads onetime and shows 404 when i refresh again in production environment
Image is present in the server but i get the message the server responded with a status of 404 (Not Found)
but when i copy the url and put in browser i get the image,but the same url i refresh i get 404.
I don't know what is the issue it happens…

Ram
- 11
- 2
1
vote
0 answers
Can't cache model using Dalli
I'm having a hard time cacheing an object.
tracked_point.rb
class TrackedPoint < ActiveRecord::Base
attr_accessible :recorded_at, :worker_id, :worker, :x, :y, :z, :geom, :location_id, :location, :frequency
attr_accessor :x, :y
belongs_to…

Tyler DeWitt
- 23,366
- 38
- 119
- 196
1
vote
1 answer
Forcing ActiveRelation to use rails cache
I have a languages table that hardly every changes. I am trying to avoid database queries on this table other the initial caching.
class Language < ActiveRecord::Base
attr_accessible :code, :name, :native_name
def…

Rajesh Kolappakam
- 2,095
- 14
- 12
1
vote
1 answer
telnet localhost 11211 fails. How to open the port?
I have a server that's running memcached but it's not working. So when I try to telnet to localhost through port 11211, it fails. How would I open the port?
root@s2:/usr/local/www/production/current/log# telnet localhost 11211
Trying…

bigpotato
- 26,262
- 56
- 178
- 334
1
vote
1 answer
Rails: Trying to understand how to do better fragment caching
In my app I am trying to incorporate better fragment caching.
Is it a best practice to do call fragments like this:
<% cache("user/#{current_user.id}/info") do %>
<%= current_user.email %> information goes here
<% end %>

dennismonsewicz
- 25,132
- 33
- 116
- 189
1
vote
0 answers
Undefined method `each' for nil:NilClass (NoMethodError) when Memcached is unavailable
My production application uses Memcachier as a cache store for Rails.
The client is dalli and it's configured in my application using :dalli_store and the memcachier gem.
If Memcachier is down in my logs I can see the following error:
app error:…

soulnafein
- 1,058
- 1
- 10
- 20
1
vote
2 answers
How to update expiration time in MemCached using Dalli?
I'm using Ruby on Rails (v3.2.13), Dalli (v2.6.4) and MemCached (v1.4.13).
I do caching like this:
result = Rails.cache.fetch("test_key", :expires_in => 1.week) do
get_data() # slow call, result of which should be cached
end
I…

Sergey Avdeev
- 910
- 1
- 8
- 16
1
vote
3 answers
Rails4 Dalli ArgumentError key cannot be blank
just run into an odd ArgumentError key cannot be blank error for a shiny Rails4 app with session store config to use memcache store
I've created an app to demo
https://github.com/khoan/rails4_dalli_session_store_error_app
ideas on how to fix?
Thanks…

Khoa Nguyen
- 1,540
- 2
- 15
- 21