Add dns-prefetch if using different host for assets or uploads (#8942)
This commit is contained in:
parent
46e4a759bb
commit
da7705b274
2 changed files with 23 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue