High performance memcached client for Ruby.
Questions tagged [dalli]
131 questions
0
votes
1 answer
rails 3 and refreshed cached object
I'm new to caching, but I've got memcached working with rails and I'm using the Dalli gem.
In the rails console, i'm able to cache an object and then read it back out no problem
Rails.cache.write("unique_posts",Post.new.get_uniques)
…

Pinpin
- 83
- 1
- 9
0
votes
0 answers
How to check weather key is available or not in memcached using rails
I am learning about memcached with rails application.
Rails.cache.fetch('key') do
"This is the string to store in key"
end
This code checks weather 'key' available in cache. If the 'key' is available, then it won't execute the block code.…

user3275435
- 1
- 5
0
votes
1 answer
Dalli/Memcached looks like caching but it's not caching in development environment
Rails 4.0.4
Unicorn
Dalli 2.7
Memcached 1.4.17
development.rb is set up to use caching in dev env:
config.cache_classes = true
config.action_controller.perform_caching = true
config.cache_store = :dalli_store
Weird thing is at the logs,…

scaryguy
- 7,720
- 3
- 36
- 52
0
votes
1 answer
Caching large ActiveRecord objects with Dalli
I can't cache large ActiveRecord objects. With small ones it's ok:
sel = Car.select("id, `key`, value").limit(1000)
Rails.cache.write('miauuu', sel)
=> true
But if they get a bit larger:
sel = Car.select("id, `key`,…

valk
- 9,363
- 12
- 59
- 79
0
votes
1 answer
Cacheing an ActiveRecord Object that has_many through:
When I try to cache an ActiveRecord object that has a has_many through: relationship, I can't cache the object until I reload or save it.
person.rb:
class Person < ActiveRecord::Base
attr_accessible :name
has_many :person_locations
has_many…

Tyler DeWitt
- 23,366
- 38
- 119
- 196
0
votes
2 answers
Dalli: You are trying to cache a Ruby object which cannot be serialized to memcached
I'm getting weird behavior when I try to save an object in memory to the database and then cache that object with Dalli.
class Infraction << ActiveRecord::Base
has_many :infraction_locations
has_many :tracked_points, through:…

Tyler DeWitt
- 23,366
- 38
- 119
- 196
0
votes
0 answers
Rails 4 - Why am I still seeing faster load times even though I have caching turned off?
I am in the process of implementing basic remote caching on Rails 4, and I am having trouble determining if it is truly working.
My setup is as follows:
Amazon EC2 instances for web/app/db layers plus a specific ec2 instance for memcached.
RoR with…

user2403366
- 31
- 3
0
votes
2 answers
How can I see the contents of the Memcachier cache on Heroku?
I need to inspect the cache, and see what IP's are blocked*, and for how long.
NB: I am on a developer/free plan.
Update:
I'm using the rack-throttle gem which stores blocked IP's in the cache.

Magne
- 16,401
- 10
- 68
- 88
0
votes
0 answers
rails how to expire low level cached records?
i want to cache my model objects in low level ( aka low level caching ) and I am doing this by memcached and dalli. i overloaded the find method in FOO class :
def self.find(id)
Rails.cache.fetch('users/' , id) do
User.find(id)
end
end
the…

Pooya
- 992
- 2
- 10
- 31
0
votes
0 answers
How can I automatically delete these redundant cache entries?
Let's say I create a new object in my Category class:
> @category = Category.create :name => "foo"
+----+------+-------------------------+-------------------------+
| id | name | created_at | updated_at …

steven_noble
- 4,133
- 10
- 44
- 77
0
votes
1 answer
What is the cache key for static assets when using Dalli, memcache
I'm trying to figure out what the cache key would be for some static assets that I would like to expire.
The file is in my app at /public/file.txt. What could the cache key be for this? I have no way of enumerating the cache keys and I have no idea…

Ringo Blancke
- 2,444
- 6
- 30
- 54
0
votes
0 answers
Rails app failing to Marshal array of ActiveRecord objects for Dalli memcache
I am attempting to memcache an ActiveRecord results array, which I have manually filtered based on some complex business rules. After an upgrade today I'm getting a nasty error based on Dalli attempting to serialize the array and failing with the…

Phil
- 2,797
- 1
- 24
- 30
0
votes
1 answer
Rails 3.2 Action Caching / Static Page
I'm wondering what the best practice is for caching static content like an about page. In this case there could not be an actual action if using a matcher like
match 'about' => 'home#about'
This entire page could be cached, except that the layout…

Rabbott
- 4,282
- 1
- 30
- 53
0
votes
1 answer
memcached localhost / aws with rails
I'm using rails and uploading images via the carrier wave plugic to AWS. I started caching the images with memcached/dalli, and it works fine for a bit...but then all images show up as broken after a while (either approx 20-30 mins or when using a…

user749798
- 5,210
- 10
- 51
- 85
0
votes
1 answer
How to make rails cache retrieval specific to a certain object id
For bar_id = 1 a cache gets formed on first access. but even if bar_id is changed to 2 later on the values of 1 is retained. How do I make it work across bar_id(s)
@foo = Rails.cache.fetch("foo_by_id", expires_in: 10.minutes) do
…

Rpj
- 5,348
- 16
- 62
- 122