From ce24aef5aa8b553e7b7003e4e0205091d9120851 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Sun, 18 Jul 2021 12:52:42 +0100 Subject: [PATCH] Add easy toggle for caching in dev with Redis --- config/environments/development.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config/environments/development.rb b/config/environments/development.rb index 2cf1818c6c..bd781cf067 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -11,7 +11,7 @@ Openfoodnetwork::Application.configure do config.cache_classes = !!ENV["PROFILE"] # :file_store is used by default when no cache store is specifically configured. - if !!ENV["PROFILE"] + if !!ENV["PROFILE"] || !!ENV["DEV_CACHING"] config.cache_store = :redis_cache_store, { driver: :hiredis, url: ENV.fetch("OFN_REDIS_URL", "redis://localhost:6379/1"), @@ -23,7 +23,7 @@ Openfoodnetwork::Application.configure do # Show full error reports and disable caching config.consider_all_requests_local = true - config.action_controller.perform_caching = !!ENV["PROFILE"] + config.action_controller.perform_caching = !!ENV["PROFILE"] || !!ENV["DEV_CACHING"] # Don't care if the mailer can't send config.action_mailer.raise_delivery_errors = false