From 1504fe72315b56c2c82329de5cf0a5a3f4b50282 Mon Sep 17 00:00:00 2001 From: Vinoth Kannan Date: Wed, 23 Sep 2020 11:52:16 +0530 Subject: [PATCH] DEV: make it possible to enable cdn in development environment. --- app/helpers/application_helper.rb | 2 +- config/environments/development.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 33eeba72b3f..bd160babd20 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -77,7 +77,7 @@ module ApplicationHelper path = path.gsub(/\.([^.]+)$/, '.gz.\1') end - elsif GlobalSetting.cdn_url&.start_with?("https") && is_brotli_req? + elsif GlobalSetting.cdn_url&.start_with?("https") && is_brotli_req? && Rails.env != "development" path = path.gsub("#{GlobalSetting.cdn_url}/assets/", "#{GlobalSetting.cdn_url}/brotli_asset/") end diff --git a/config/environments/development.rb b/config/environments/development.rb index 83086237dbb..55a3f3bc106 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -15,6 +15,8 @@ Discourse::Application.configure do config.consider_all_requests_local = true config.action_controller.perform_caching = false + config.action_controller.asset_host = GlobalSetting.cdn_url + # Print deprecation notices to the Rails logger config.active_support.deprecation = :log