Skip to content

Instantly share code, notes, and snippets.

@vilusa
Created September 3, 2021 18:56
Show Gist options
  • Save vilusa/ca5ba365d68240ac86dfb1e907009b68 to your computer and use it in GitHub Desktop.
Save vilusa/ca5ba365d68240ac86dfb1e907009b68 to your computer and use it in GitHub Desktop.
Rails Redis Cache Configuration
# For TLS Connections
config.cache_store = :redis_cache_store, {
url: ENV.fetch('CACHE_STORE_REDIS_TLS_URL') { ENV['CACHE_STORE_REDIS_URL'] || 'redis://127.0.0.1:6379' },
db: 0,
connect_timeout: 20, # Defaults to 20 seconds
read_timeout: 1, # Defaults to 1 second
write_timeout: 1, # Defaults to 1 second
reconnect_delay: 1.5 ,
reconnect_delay_max: 10.0,
reconnect_attempts: 10, # Defaults to 0
ssl_params: { verify_mode: OpenSSL::SSL::VERIFY_NONE },
expires_in: 12.hours,
}
@dabit
Copy link

dabit commented Sep 26, 2023

Came here for the same reason, didn't work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment