Skip to content

Commit

Permalink
Turn on active record cache_versioning (#1149)
Browse files Browse the repository at this point in the history
This keeps the version seperate from Rails standard cache_key, which
allows for better recycling of cached entries as things get updated
freqently.  This shouldn't impact our app right now, as we are only
using our own manual cache keys for analytics.

For more details on how recyclable cache keys work, see:

* rails/rails#29092
* https://dzone.com/articles/cache-invalidation-complexity-rails-52-and-dalli-c
  • Loading branch information
rsanheim committed Jul 20, 2020
1 parent 96b22a3 commit 1c0a08c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/new_framework_defaults_5_2.rb
Expand Up @@ -8,7 +8,7 @@

# Make Active Record use stable #cache_key alongside new #cache_version method.
# This is needed for recyclable cache keys.
# Rails.application.config.active_record.cache_versioning = true
Rails.application.config.active_record.cache_versioning = true

# Use AES-256-GCM authenticated encryption for encrypted cookies.
# Also, embed cookie expiry in signed or encrypted cookies for increased security.
Expand Down

0 comments on commit 1c0a08c

Please sign in to comment.