jetty / jetty.project

Eclipse Jetty® - Web Container & Clients - supports HTTP/2, HTTP/1.1, HTTP/1.0, websocket, servlets, and more
https://eclipse.dev/jetty
Other
3.83k stars 1.91k forks source link

Configurable HTTP/2 Response Prioritization and Behavior #176

Closed jmcc0nn3ll closed 7 years ago

jmcc0nn3ll commented 8 years ago

migrated from Bugzilla #449789 status ASSIGNED severity normal in component http2 for 9.2.x Reported in version 9.3.0 on platform All Assigned to: Project Inbox

On 2014-11-03 10:09:09 -0500, Joakim Erdfelt wrote:

There should be some configurable for HTTP/2 responses to control prioritization, and also response behavior.

We could initially focus on response prioritization based on mime-type, then move into context (path), and eventually some customization into how a specific response should behave.

Some thoughts on an example configuration:

:: - can be a mime-type like "image/jpeg", "text/html", or "text/css". or a patch spec (any type that starts with '/'). or "*" for a catch all for those responses that don't match anything more specific in this configuration. - is a number, where priority 1 is more important than say priority 100 - this is to configure behavior of this specific priority, such as sending the first 4k of an image response early, to allow a browser to establish metadata information on the image from its headers, while waiting for the rest of the response at a lower priority. Example configuration: text/html:1 /rest/api/_:1 text/css:2 text/javascript:2 image/jpeg:3:image-header image/png:3:image-header /avatars/_:4 /thumbnails/*:4 image/jpeg:5 image/png:5 *:20 video/mpeg:600 application/pdf:800
sbordet commented 7 years ago

It's browsers that want to control prioritization. Doing it on the server is probably working against what browsers need for fast rendering.