You might be interested in what is going on in Drupal 8 with regard to pre-caching and a newer (now in core I think) module called BigPipe. It does some of what you describe in PHP in a fairly generic way. AFAIK, you just enable this module and ensure caching is enabled. From that point on, slower assets load when ready so the rest of the site is already visible... like Facebook.