From c978c67666f61fefd44dd0f0b46526d3a35bc6ff Mon Sep 17 00:00:00 2001 From: Sam Bostock Date: Wed, 21 Oct 2020 00:03:12 -0400 Subject: [PATCH] Document :mem_cache_store $MEMCACHE_SERVERS incompatibility `:dalli_store` falls back to `$MEMCACHE_SERVERS` if no addresses are given, whereas `:mem_cache_store` goes straight to `localhost:11211`. This is not immediately obvious, especially to users not providing any custom options, and makes it easy to accidentally effectively disable caching entirely (if `localhost:11211` is not a memcached server). Note that https://github.com/rails/rails/pull/40420 would add support. --- 3.0-Upgrade.md | 2 ++ History.md | 2 ++ 2 files changed, 4 insertions(+) diff --git a/3.0-Upgrade.md b/3.0-Upgrade.md index d06f0936..9aa8eaba 100644 --- a/3.0-Upgrade.md +++ b/3.0-Upgrade.md @@ -5,6 +5,8 @@ This major version update contains several backwards incompatible changes. * **:dalli_store** has been removed. Users should migrate to the official Rails **:mem_cache_store**, documented in the [caching guide](https://guides.rubyonrails.org/caching_with_rails.html#activesupport-cache-memcachestore). + Note that `:mem_cache_store` does not check for `ENV['MEMCACHE_SERVERS']`, + so you may need to explicitly provide it. * Attempting to store a larger value than allowed by memcached used to print a warning and truncate the value. This now raises an error to prevent silent data corruption. diff --git a/History.md b/History.md index e80c1d2e..291df3e7 100644 --- a/History.md +++ b/History.md @@ -6,6 +6,8 @@ Dalli Changelog - DEPRECATION: :dalli_store will be removed in Dalli 3.0. Use Rails' official :mem_cache_store instead. https://guides.rubyonrails.org/caching_with_rails.html + Note that `:mem_cache_store` does not check for `ENV['MEMCACHE_SERVERS']`, + so you may need to explicitly provide it. - Add new `digest_class` option to Dalli::Client [#724] - Don't treat NameError as a network error [#728] - Handle nested comma separated server strings (sambostock)