Github Add `config.action_view.preload_links_header` option by pixeltrix · Pull...
source link: https://github.com/rails/rails/pull/40882
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Member
pixeltrix commented 28 days ago
PR #39939 added support for the Link
header being generated automatically when using stylesheet_link_tag
andjavascript_include_tag
. However not everything should be preloaded, e.g. a link to a legacy IE stylesheet has no need to be preloaded because IE doesn't support the header and in some browsers it will trigger the preload even though it's not used since it's inside an IE conditional comment. This leads to increased bandwith costs and slower application performance.
To allow more flexibility for sites that may have complex needs for the Link
header this commit adds a configuration option that disables it completely and leaves it up to the application to decide how to handle generating a Link
header.
NOTE: The intention is to backport this to 6-1-stable and add a new entry to new_framework_defaults_6_1.rb
so that upgrading applications can opt into the default option of it being enabled since they're the most likely to be affected by the legacy IE issue.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK