-
Notifications
You must be signed in to change notification settings - Fork 22k
Closed
Description
Memcached supports setting the TTL to 0 to cache the record permanently. However, trying to cache a value through MemCacheStore
with exipres_in: 0
option instead causes the record to not be cached at all.
Steps to reproduce
(not providing a test for repro as it requires an externally running memcached server so it is not really self contained, hopefully this is ok as the repro steps are very basic)
Start a memcached server locally: memcached -p 11211
In a Rails console, run
cache = ActiveSupport::Cache.lookup_store(:mem_cache_store, "localhost:11211", {})
cache.write("key", "value", :expires_in => 0)
cache.read("key") # this will return `nil`
Expected behavior
Entry should be cached indefinitely.
Actual behavior
Entry is not cached at all.
System configuration
Rails version: 6.1.4.1
Ruby version: 2.6.5
lfalcao