Server push is the ability of the server to anticipate what will be needed by the client in advance of the client’s request. It lets the server pre-populate the browser’s cache in advance of the browser asking for the resource to put in the cache.
Server push is the most visible of the improvements in HTTP/2 to appear in the servlet API. All of the new features in HTTP/2, including server push, are aimed at improving the performance of the web browsing experience.
Server push derives its contribution to improved browser performance from the
fact that servers know what additional assets (such as images, stylesheets,
and scripts) go along with initial requests. For example, servers might know
that whenever a browser requests
To use server push, obtain a reference to a
To view the GlassFish samples code for this feature, see https://github.com/javaee/glassfish-samples/tree/master/ws/javaee8.