Add config.action_view.preload_links_header
option
#40882
Merged
+186
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR #39939 added support for the
Link
header being generated automatically when usingstylesheet_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 aLink
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.