Jetty Logo
Version: 9.4.31.v20200723
Contact the core Jetty developers at

private support for your internal/customer projects ... custom extensions and distributions ... versioned snapshots for indefinite support ... scalability guidance for your apps and Ajax/Comet projects ... development services for sponsored feature development

Configuring HTTP/2 Push

HTTP/2 Push is a mechanism that allows the server to send multiple resources to the client for a single client request. This will reduce the amount of round-trips necessary to retrieve all the resources that make up a web page and can significantly improve the page load time.

HTTP/2 Push can be automated in your application by configuring a PushCacheFilter in the web.xml, in this way:

<?xml version="1.0" encoding="UTF-8"?>



PushCacheFilter analyzes the HTTP requests for resources that arrive to your web application. Some of these requests contain the HTTP Referer header that points to a resource that has been requested previously.

This allows the PushCacheFilter to organize resources in a tree, for example a root index.html resource having two children resources, styles.css and application.js, and styles.css having a child resource, background.png. The root resource is called the primary resource, while descendant resources are called secondary resources.

The resource tree is built using a time window so that when a root resource is requested, only subsequent requests that are made within the time window will be added to the resource tree. The resource tree can also be limited in size so that the number of secondary resources associated to a primary resource is limited.

By default, only the resource path (without the query string) is used to associate secondary resources to the primary resource, but you can configure PushCacheFilter to take the query string into account.

PushCacheFilter can be configured with the following init-params:

See an error or something missing? Contribute to this documentation at Github!(Generated: 2020-07-23)