1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/actionview/test
eileencodes 59a02fb7bc Implement H2 Early Hints for Rails
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]
2017-10-04 09:17:21 -04:00
..
actionpack Fix RuboCop offenses 2017-08-16 17:55:25 +09:00
activerecord Remove unused methods from RenderPartialWithRecordIdentificationController 2017-09-30 17:38:27 +09:00
fixtures Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
lib/controller Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
template Implement H2 Early Hints for Rails 2017-10-04 09:17:21 -04:00
tmp Unify the internal source control .keep file name 2017-08-24 13:40:26 +09:00
ujs Use ssl in guide and comment [ci skip] 2017-08-19 08:23:37 +09:00
abstract_unit.rb Include ActionDispatch::DrawOnce in ActiveSupport::TestCase 2017-09-27 08:51:37 +09:00
active_record_unit.rb Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00