Server Push
Last updated
Last updated
One highlight feature of HTTP/2 is Server Push. Servlet 4.0 add PushBuilder
to handle push.
An example of enabling Servlet Push.
Run this application on Glassfish v5 in NetBeans IDE, it will open https://localhost:8181/servlet-push/ in browser instead of http://localhost:8080/servlet-push/.
There is a warning flag on the HTTPS icon of address bar, the SSL certificate in Glassfish v5 is not recognized by Firefox. Click it and add localhost
to the exception and make Firefox trust it.
In the Network tab of developer tools, you will the main.css is initialized by Push.
Grab the source codes from my GitHub account, and have a try.