about summary refs log tree commit diff
path: root/app/helpers
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-10-10 01:31:10 +0200
committerGitHub <noreply@github.com>2018-10-10 01:31:10 +0200
commitda7705b2746b36ccbe093d404d3f4c83a9b5e13e (patch)
treed7a050c01c70cf3b3278171646372c117c2c3528 /app/helpers
parent46e4a759bbe0e78fdbb4c1573a404bd4b531315a (diff)
Add dns-prefetch if using different host for assets or uploads (#8942)
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/application_helper.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index f8e2c0e11..8533b398a 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -81,4 +81,20 @@ module ApplicationHelper
     output << 'rtl' if locale_direction == 'rtl'
     output.reject(&:blank?).join(' ')
   end
+
+  def cdn_host
+    ENV['CDN_HOST'].presence
+  end
+
+  def cdn_host?
+    cdn_host.present?
+  end
+
+  def storage_host
+    ENV['S3_ALIAS_HOST'].presence || ENV['S3_CLOUDFRONT_HOST'].presence
+  end
+
+  def storage_host?
+    storage_host.present?
+  end
 end