"Idea: web server should observe traffic, learn what resources page needs, and use http/2 push automatically. No rel=subresource hints needed @pornelski"
I may actually blog about this at some point, but I've been circling this problem six ways from Sunday for about 6 years now and I've tried all sorts of solutions which inform my opinions about what might and might not work well for these problems - of course, none of them actually used http2/push since it wasn't a thing - but it's pretty easy to mentally map between them.
-
Anything that requires analysis of use to make optimizations "smartly" without your having to write something requires, well, data. Since the wins here could be really signficant, it means that for anyone using your site/app prior to that it means the costs of not having the optimizations grow really fast - so people jump to known solutions like bundling and manual optimizations which help defeat the purpose/promise of something like this.
-
It also potentially needs more smarts than just simple stats - I have apps that have different "kinds" of users... Either you have to forgoe anything that isn't perfectly symetrical or you have to make it understand that so that it can send conditionals for user kind A to those kinds of users while sending conditionals for B to those and so on.
-
Static analysis can do a lot at a normalized price and happen before anyone hits the page, getting rid of the costs of the above, but in exchange for less perfect optimizations.
-
All of this said, the server is generally ignorant of what the client already has, so forcing things down blindly without them being requested can also easily kill the advantage of cache if you don't have a scheme for handling that as well.
I have some working systems which do some of this, but I dont think any of it is perfect... A mix of static and some simple "startup optimization rules" can go pretty far without getting too crazy.