mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
fd8c36707f
The `expires_in` option is easy to misremember or mistype as `expire_in` or `expired_in`, with potentially harmful results. If a developer wants to cache a value for only 2 seconds but mistakenly types `expire_in: 2.seconds`, that value will instead be cached for the default time, likely 6 hours, meaning that users of the site will see the same data for much longer than they should, and the only recovery (short of waiting for the 6 hours to elapse) is to manually expire all relevant keys. This commit allows cache stores to recognize these common typos as aliases by normalizing them before consuming the options. In general, we should be careful about adding too many aliases for options to the cache stores, since each option key used by the base Cache::Store class is one fewer key that each cache implementation can customize for itself. This case was approved because of the similarity of the aliases to the root key and the potential damage caused by mistaking them. Fixes #39850. |
||
---|---|---|
.. | ||
autoloading_cache_behavior.rb | ||
cache_delete_matched_behavior.rb | ||
cache_increment_decrement_behavior.rb | ||
cache_instrumentation_behavior.rb | ||
cache_store_behavior.rb | ||
cache_store_coder_behavior.rb | ||
cache_store_version_behavior.rb | ||
connection_pool_behavior.rb | ||
encoded_key_cache_behavior.rb | ||
failure_safety_behavior.rb | ||
local_cache_behavior.rb |