Commit 9912595
Apu Islam
feat(http2): implement 103 Early Hints support
Add HTTP/2 103 Early Hints implementation with client and server support:
- Add builder opt-in pattern via enable_informational() for zero-cost abstraction
- Create early_hints_pusher() API for server-side hint transmission via mpsc channel
- Add InformationalCallback system for client-side informational response handling
- Extend HTTP/2 client builder with informational_responses() configuration method
- Implement informational response polling in h2 client task with callback invocation
- Add server-side informational response forwarding using h2's send_informational API
- Include test coverage: 11 integration tests, 18 unit tests, 2 doc tests
- Add complete working example with TLS, resource preloading, and performance monitoring
- Update Cargo.toml with h2 = 0.4.13 dependency requirement
The implementation enables servers to send resource preload hints before final responses,
allowing browsers to start downloading critical resources early and improve page load
performance. Feature is opt-in and disabled by default for zero overhead when not used.
Clients can register callbacks to process 103 Early Hints and other informational responses.
Closes #3980, #24261 parent 4b30501 commit 9912595
File tree
14 files changed
+2593
-9
lines changed- examples
- src
- client/conn
- ext
- proto
- h1
- h2
- server/conn
- tests
14 files changed
+2593
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
84 | 88 | | |
85 | 89 | | |
86 | 90 | | |
87 | | - | |
| 91 | + | |
88 | 92 | | |
89 | 93 | | |
90 | 94 | | |
| |||
201 | 205 | | |
202 | 206 | | |
203 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
0 commit comments