Skip to content

Commit

Permalink
Document :mem_cache_store $MEMCACHE_SERVERS incompatibility
Browse files Browse the repository at this point in the history
`:dalli_store` falls back to `$MEMCACHE_SERVERS` if no addresses are
given, whereas (prior to Rails 6.1) `: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 rails/rails#40420 added support for
`$MEMCACHE_SERVERS`, and is slated for release as part of Rails 6.1.

[ci skip]
  • Loading branch information
sambostock committed Oct 21, 2020
1 parent 1fbef3c commit 918787a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions 3.0-Upgrade.md
Expand Up @@ -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']`
prior to Rails 6.1, 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.
Expand Down
2 changes: 2 additions & 0 deletions History.md
Expand Up @@ -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']`
prior to Rails 6.1, 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)
Expand Down

0 comments on commit 918787a

Please sign in to comment.