@@ -138,6 +138,8 @@ Requirement Levels
138
138
139
139
* RFC 7617 The 'Basic' HTTP Authentication Scheme
140
140
141
+ * RFC 8297 An HTTP Status Code for Indicating Hints
142
+
141
143
* RFC 9110 HTTP Semantics
142
144
143
145
* RFC 9111 HTTP Caching
@@ -1655,43 +1657,49 @@ thrown.
1655
1657
1656
1658
=== HTTP/2 Server Push
1657
1659
1658
- Server push is the most visible of the
1659
- improvements in HTTP/2 to appear in the servlet API. All of the new
1660
- features in HTTP/2, including server push, are aimed at improving the
1661
- perceived performance of the web browsing experience. Server push
1662
- derives its contribution to improved perceived browser performance from
1663
- the simple fact that servers are in a much better position than clients
1664
- to know what additional assets (such as images, stylesheets and scripts)
1665
- go along with initial requests. For example, it is possible for servers
1666
- to know that whenever a browser requests `index.html`, it will shortly
1667
- thereafter request `header.gif`, `footer.gif` and `style.css`. Since
1668
- servers know this, they can preemptively start sending the bytes of
1669
- these assets along side the bytes of the `index.html`.
1670
-
1671
- To use server push, obtain a reference to a
1672
- `PushBuilder` from an `HttpServletRequest`, mutate the builder as
1673
- desired, then call `push()`. Please see the javadoc for method
1660
+ Server push was intended to improve the perceived performance of the web
1661
+ browsing experience. The basis for this was the idea that servers are in a much
1662
+ better position than clients to know what additional assets (such as images,
1663
+ stylesheets and scripts) go along with initial requests. For example, it is
1664
+ possible for servers to know that whenever a browser requests `index.html`, it
1665
+ will shortly require `header.gif`, `footer.gif` and `style.css`. Since servers
1666
+ know this, they can preemptively start sending the bytes of these assets along
1667
+ side the bytes of the `index.html`.
1668
+
1669
+ Server push has not been widely adopted and the leading browsers have removed
1670
+ support for server push. This is because the server does not have visibility
1671
+ into either the client cache or any intermediate caches that may be present and,
1672
+ as such, is unable to identify which resources need to be pushed and which the
1673
+ client already has. Server push has essentially been replaced by RFC 8297 (Early
1674
+ Hints).
1675
+
1676
+ Server push support was added in version 4 of this specification. As of version
1677
+ 6.1 of this specification, containers are not required to support server push
1678
+ and may always return `null` from
1679
+ `jakarta.servlet.http.HttpServletRequest.newPushBuilder()`
1680
+
1681
+ To use server push, obtain a reference to a `PushBuilder` from an
1682
+ `HttpServletRequest`, mutate the builder as desired, then call `push()`. Please
1683
+ see the javadoc for method
1674
1684
`jakarta.servlet.http.HttpServletRequest.newPushBuilder()` and class
1675
1685
`jakarta.servlet.http.PushBuilder` for the normative specification. The
1676
- remainder of this section calls out implementation requirements with
1677
- respect to the section titled “Server Push” in the HTTP/2 specification
1678
- version referenced in <<Other Important References>>.
1679
-
1680
- Unless explicitly excluded, Servlet {spec-version}
1681
- containers must support server push as specified in the HTTP/2
1682
- specification section “Server Push”. Containers must enable server push
1683
- if the client is capable of speaking HTTP/2, unless the client has
1684
- explicitly disabled server push by sending a `SETTINGS_ENABLE_PUSH`
1685
- setting value of 0 (zero) for the current connection. In that case, for
1686
- that connection only, server push must not be enabled.
1687
-
1688
- In addition to allowing clients to disable
1689
- server push with the `SETTINGS_ENABLE_PUSH` setting, servlet containers
1690
- must honor a client’s request to not receive a pushed response on a
1691
- finer grained basis by heeding the `CANCEL` or `REFUSED_STREAM` code
1692
- that references the pushed stream’s stream identifier. One common use of
1693
- this interaction is when a browser already has the resource in its
1694
- cache.
1686
+ remainder of this section calls out implementation requirements with respect to
1687
+ the section titled “Server Push” in the HTTP/2 specification version referenced
1688
+ in <<Other Important References>>.
1689
+
1690
+ Servlet {spec-version} containers may support server push as specified in the
1691
+ HTTP/2 specification section “Server Push”. Containers may enable server push if
1692
+ the client is capable of speaking HTTP/2, unless the client has explicitly
1693
+ disabled server push by sending a `SETTINGS_ENABLE_PUSH` setting value of 0
1694
+ (zero) for the current connection. In that case, for that connection only,
1695
+ server push must not be enabled.
1696
+
1697
+ In addition to allowing clients to disable server push with the
1698
+ `SETTINGS_ENABLE_PUSH` setting, servlet containers must honor a client’s request
1699
+ to not receive a pushed response on a finer grained basis by heeding the
1700
+ `CANCEL` or `REFUSED_STREAM` code that references the pushed stream’s stream
1701
+ identifier. One common use of this interaction is when a browser already has the
1702
+ resource in its cache.
1695
1703
1696
1704
=== Cookies
1697
1705
@@ -8648,6 +8656,10 @@ Add ByteBuffer support to `ServletInputStream` and `ServletOutputStream`.
8648
8656
Clarify the expected behavior if the container receives an HTTP request using
8649
8657
the `CONNECT` method.
8650
8658
8659
+ link:https://github.com/eclipse-ee4j/servlet-api/issues/538[Issue 538]::
8660
+ Deprecate support for HTTP/2 server push and make implementaing support for this
8661
+ feature optional.
8662
+
8651
8663
=== Changes Since Jakarta Servlet 5.0
8652
8664
8653
8665
The minimum Java version has been increased to Java 11.
0 commit comments