Since Dalli is potentially compressing the value after we've passed it in, it's impossible to know ahead of time if a value will be too large once compressed. Instead of raising an exception we return false to signal that the value wasn't stored.
ActiveSupport is doing this check too, but it's actually a bug because the variable is stored as a thread-local and defaults to false which means on a multi-threaded webserver the value will _always_ be false unless you set it at the top of every request. I've been meaning to send a pull to Rails doing this same thing but haven't had the time. The check was put in before ActiveSupport::Instrumentation was changed to not actually do any work unless there were subscribers setup listening for the events. So to "disable" this instrumentation all the application needs to do is not subscribe to these events. Rails doesn't by default, meaning this is "disabled" by default.
this can be caught by the application and used to purge the offending key from memcached