0
0
Fork 0

Add dns-prefetch if using different host for assets or uploads (#8942)

This commit is contained in:
Eugen Rochko 2018-10-10 01:31:10 +02:00 committed by GitHub
parent 46e4a759bb
commit da7705b274
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View file

@ -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