From b4da795f7927a2d59816c09a39ffc1232b4f224f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 15 Jul 2023 16:16:49 +0200 Subject: [PATCH] Preload CSS and JavaScript files This is the default setting in Rails 6.1, and generates an extra tag in the HTML which tells the browser to download and cache these files as soon as possible, even before they're needed. This might not be that relevant in our application, since on most pages we only generate one CSS and one JS file. But it might make it easier to move the `javascript_include_tag` statement to the bottom of the page in the future if we detect that doing so increases performance. --- config/initializers/new_framework_defaults_6_1.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/initializers/new_framework_defaults_6_1.rb b/config/initializers/new_framework_defaults_6_1.rb index 26a97d92b..dd5b6b9c6 100644 --- a/config/initializers/new_framework_defaults_6_1.rb +++ b/config/initializers/new_framework_defaults_6_1.rb @@ -49,4 +49,4 @@ Rails.application.config.action_mailer.deliver_later_queue_name = nil # Generate a `Link` header that gives a hint to modern browsers about # preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`. -# Rails.application.config.action_view.preload_links_header = true +Rails.application.config.action_view.preload_links_header = true