mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
59a02fb7bc
When puma/puma#1403 is merged Puma will support the Early Hints status code for sending assets before a request has finished. While the Early Hints spec is still in draft, this PR prepares Rails to allowing this status code. If the proxy server supports Early Hints, it will send H2 pushes to the client. This PR adds a method for setting Early Hints Link headers via Rails, and also automatically sends Early Hints if supported from the `stylesheet_link_tag` and the `javascript_include_tag`. Once puma supports Early Hints the `--early-hints` argument can be passed to the server to enable this or set in the puma config with `early_hints(true)`. Note that for Early Hints to work in the browser the requirements are 1) a proxy that can handle H2, and 2) HTTPS. To start the server with Early Hints enabled pass `--early-hints` to `rails s`. This has been verified to work with h2o, Puma, and Rails with Chrome. The commit adds a new option to the rails server to enable early hints for Puma. Early Hints spec: https://tools.ietf.org/html/draft-ietf-httpbis-early-hints-04 [Eileen M. Uchitelle, Aaron Patterson] |
||
---|---|---|
.. | ||
erb | ||
form_helper | ||
testing | ||
active_model_helper_test.rb | ||
asset_tag_helper_test.rb | ||
atom_feed_helper_test.rb | ||
capture_helper_test.rb | ||
compiled_templates_test.rb | ||
controller_helper_test.rb | ||
date_helper_i18n_test.rb | ||
date_helper_test.rb | ||
dependency_tracker_test.rb | ||
digestor_test.rb | ||
erb_util_test.rb | ||
form_collections_helper_test.rb | ||
form_helper_test.rb | ||
form_options_helper_i18n_test.rb | ||
form_options_helper_test.rb | ||
form_tag_helper_test.rb | ||
html_test.rb | ||
javascript_helper_test.rb | ||
log_subscriber_test.rb | ||
lookup_context_test.rb | ||
number_helper_test.rb | ||
output_safety_helper_test.rb | ||
partial_iteration_test.rb | ||
record_identifier_test.rb | ||
record_tag_helper_test.rb | ||
render_test.rb | ||
resolver_cache_test.rb | ||
resolver_patterns_test.rb | ||
sanitize_helper_test.rb | ||
streaming_render_test.rb | ||
tag_helper_test.rb | ||
template_error_test.rb | ||
template_test.rb | ||
test_case_test.rb | ||
test_test.rb | ||
text_helper_test.rb | ||
text_test.rb | ||
translation_helper_test.rb | ||
url_helper_test.rb |