|
|
|
|
|
by acdha
3904 days ago
|
|
The simplest way would seem to be a directive to push static resources: <Location />
ServerPush /static/css/main.css
ServerPush /static/js/main.js
</Location>
<LocationMatch "^/$">
ServerPush /static/img/gigantic-homepage-image.jpg
</LocationMatch>
<Location /maps/>
ServerPush /static/js/leaflet.js
</Location>
I believe this could even avoid the need to include cache-busters in the URL since you could push with an ETag and the client can terminate if it already has the appropriate bytes without the incredible performance hit of using ETags with HTTP 1. |
|
Jetty's approach to this problem is really interesting. Using HTTP referrer headers, it builds up a tree of resources that are often fetched together. Then, it optimistically pushes companion resources down. https://github.com/eclipse/jetty.project/blob/master/jetty-s...