From 96aca6d99439979b9a3e481426b2c7ab6598f160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Kowalski?= Date: Tue, 17 Nov 2020 04:26:37 +0100 Subject: [PATCH] Move CSS link tags above JS in the head CSS are blocking resources, so keeping them below JS delays rendering of the page. CSS should be loaded ASAP. This change speeds up first contentful paint by 0.2s on localhost. The slower the device, the bigger the difference could be. --- app/views/layouts/application.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index b79c327d5bc..165ece79e1e 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -9,6 +9,8 @@ <%= render partial: "layouts/head" %> <%= discourse_csrf_tags %> + <%= render partial: "common/discourse_stylesheet" %> + <%- if SiteSetting.enable_escaped_fragments? %> <%- end %> @@ -51,7 +53,6 @@ <%- end %> - <%= render partial: "common/discourse_stylesheet" %> <%= yield :head %>