Jetty Logo
Version: 9.2.3.v20140905
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 from 1 day to full product delivery

Implement a custom SPDY PushStrategy

PushStrategy API

The ReferrerPushStrategy that is distributed with Jetty (Configuring SPDY push) does a great job to automatically detect subresources to push for a given main resource. However there might be reasons to implement your own push strategy.

PushStrategy API

The interface that needs to be implemented isPushStrategy. For each request Jetty will call the apply method, which will return a Set with the resources to push. This is the apply method's signature:

The parameters are the Stream for the primary resource request, the request and the response header fields. Based on this information the implementation has to decide which resources to push and return a Set<String> containing the URLs for the resources to push. Jetty will then open a push stream for each URL returned in that list and push the contents of that file. This is the only method that you need to implement.


For reference and as a working example use the ReferrerPushStrategy source code:

See an error or something missing? Contribute to this documentation at Github!(Generated: 2014-10-23T01:00:27-07:00)