about summary refs log tree commit diff
path: root/app/views/layouts
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/views/layouts
parent46e4a759bbe0e78fdbb4c1573a404bd4b531315a (diff)
Add dns-prefetch if using different host for assets or uploads (#8942)
Diffstat (limited to 'app/views/layouts')
-rwxr-xr-xapp/views/layouts/application.html.haml7
1 files changed, 7 insertions, 0 deletions
diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml
index 436864237..3d63dc0f3 100755
--- a/app/views/layouts/application.html.haml
+++ b/app/views/layouts/application.html.haml
@@ -3,6 +3,13 @@
   %head
     %meta{ charset: 'utf-8' }/
     %meta{ name: 'viewport', content: 'width=device-width, initial-scale=1' }/
+
+    - if cdn_host?
+      %link{ rel: 'dns-prefetch', href: cdn_host }/
+
+    - if storage_host?
+      %link{ rel: 'dns-prefetch', href: storage_host }/
+
     %link{ rel: 'icon', href: favicon_path, type: 'image/x-icon' }/
     %link{ rel: 'apple-touch-icon', sizes: '180x180', href: '/apple-touch-icon.png' }/
     %link{ rel: 'mask-icon', href: '/mask-icon.svg', color: '#2B90D9' }/