usar redis como cache

This commit is contained in:
f 2019-07-29 15:51:09 -03:00
parent 5045ec8173
commit 45568bbb12
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 18 additions and 13 deletions

View file

@ -36,6 +36,7 @@ Metrics/MethodLength:
Metrics/BlockLength:
Exclude:
- 'config/environments/development.rb'
- 'config/environments/production.rb'
- 'config/initializers/devise.rb'
- 'db/schema.rb'

View file

@ -1,11 +1,13 @@
# frozen_string_literal: true
Rails.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# Settings specified here will take precedence over those in
# config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
# In the development environment your application's code is reloaded
# on every request. This slows down response time but is perfect for
# development since you don't have to restart the web server when you
# make code changes.
config.cache_classes = false
# Do not eager load code on boot.
@ -18,7 +20,7 @@ Rails.application.configure do
if Rails.root.join('tmp/caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.cache_store = :memory_store
config.cache_store = :redis_cache_store
config.public_file_server.headers = {
'Cache-Control' => "public, max-age=#{2.days.seconds.to_i}"
}
@ -39,8 +41,8 @@ Rails.application.configure do
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# Debug mode disables concatenation and preprocessing of assets. This
# option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
@ -50,8 +52,9 @@ Rails.application.configure do
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# Use an evented file watcher to asynchronously detect changes in
# source code, routes, locales, etc. This feature depends on the
# listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
CarrierWave.configure do |config|
@ -63,5 +66,6 @@ Rails.application.configure do
config.action_mailer.perform_caching = false
config.action_mailer.delivery_method = :letter_opener
config.action_mailer.perform_deliveries = true
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
config.action_mailer.default_url_options = { host: 'localhost',
port: 3000 }
end

View file

@ -56,12 +56,12 @@ Rails.application.configure do
config.log_tags = [:request_id]
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
config.cache_store = :redis_cache_store
# Use a real queuing backend for Active Job (and separate queues per
# environment)
# config.active_job.queue_adapter = :resque
# config.active_job.queue_name_prefix = "sutty_#{Rails.env}"
config.active_job.queue_adapter = :sidekiq
config.active_job.queue_name_prefix = "sutty_#{Rails.env}"
config.action_mailer.perform_caching = false
# Ignore bad email addresses and do not raise email delivery errors.