Skip to content

Loading…

Does Dalli expire caches in all boxes? #304

Closed
kidlab opened this Issue · 1 comment

2 participants

@kidlab

This is not an issue, just a question. I'm sorry for this.

Assume that we're using a memcached cluster with two servers: memcached1(box1) and memcached2 (box2).

  • User A and user B share a same resource.
  • User A login and read the resource cached in box1.
  • User B login and read the resource cached in box2.
  • User A updates the shared resource and expires the cache on box1
  • User B does not see the updated resource and still get the cached on in box2.

It's my understanding so far, I'm not sure how the cache expiration works in cluster environment.
Especially, when we want to eagerly expire the cache, will it expire on all boxes?
When we have a configuration like this in TWO rails servers:

config.cache_store = :dalli_store, 'memcached1', 'memcached2'

Can you please explain it?
Thanks for your interest.

@mperham
Collaborator

A resource is always cached on one box. User A and B would both access and expire the resource on the same box.

@mperham mperham closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.