New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable send_preload_links_header outright #51436
Labels
Comments
I see there is also |
4 tasks
stanhu
added a commit
to stanhu/rails
that referenced
this issue
Mar 28, 2024
This commit adds a `preload_links_header` option to `preload_link_tag` to disable sending of the Link header in the HTTP response. Currently `ActionView::Helpers::AssetTagHelper.preload_links_header` only controls whether `javascript_include_tag` and `stylesheet_link_tag` send the Link header, but there is no way to control the behavior of `preload_link_tag`. We could just check that variable, but existing applications might be relying on `preload_link_tag` to add the header. Users also might want control over this on a per call basis. Closes rails#51436
stanhu
added a commit
to stanhu/rails
that referenced
this issue
Mar 28, 2024
This commit adds a `preload_links_header` option to `preload_link_tag` to disable sending of the Link header in the HTTP response. Currently `ActionView::Helpers::AssetTagHelper.preload_links_header` only controls whether `javascript_include_tag` and `stylesheet_link_tag` send the Link header, but there is no way to control the behavior of `preload_link_tag`. We could just check that variable, but existing applications might be relying on `preload_link_tag` to add the header. Users also might want control over this on a per call basis. Closes rails#51436
stanhu
added a commit
to stanhu/rails
that referenced
this issue
Mar 28, 2024
This commit adds a `preload_links_header` option to `preload_link_tag` to disable sending of the Link header in the HTTP response. Currently `ActionView::Helpers::AssetTagHelper.preload_links_header` only controls whether `javascript_include_tag` and `stylesheet_link_tag` send the Link header, but there is no way to control the behavior of `preload_link_tag`. We could just check that variable, but existing applications might be relying on `preload_link_tag` to add the header. Users also might want control over this on a per call basis. Closes rails#51436
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Suppose you have a partial like this:
If the partial is not cached, then
preload_link_tag
will callsend_preload_links_header
, which modifies theLink
HTTP header.However, if the partial is cached, then the
Link
HTTP header is not sent.This is a surprising side effect of caching
preload_link_tag
. I was surprised thatsend_preload_links_header
is even called in the first place.#48405 lowered the max header size from 8K to 1000 bytes, but I think Rails should go farther than that: provide an option to disable this sending altogether, perhaps as an argument to
preload_link_tag
. For example:The text was updated successfully, but these errors were encountered: