How to organize production web resources serve?

I use nodejs as a server technology on the SPA web application with a custom router engine and require.js as a dependency manager.

I'm looking for a way to organize web resources serving with following goals achieved:

  • Only resources required for current page (location hash) are loaded.
  • Resources are bundled and bundles contain only required for location resources.
  • Bundled resources are cacheable in the browser
  • Some resources are loaded from 3rd party networks (CDNs, googleapis)

Is there a way to achieve all 4 goals with requirejs or headjs, or it does require additional middle tier?