ember-cli / broccoli-asset-rev

Broccoli plugin to add fingerprint checksums and CDN URLs to your assets
MIT License
87 stars 84 forks source link

Possible for prepend to support multiple urls? #56

Closed krzkrzkrz closed 8 years ago

krzkrzkrz commented 9 years ago

At the moment prepend assumes a string (i.e. https://subdomain.cloudfront.net/). However, it is possible to create CNAME/ALIAS records that point at the CDN url. For example: cdn1.foobar.com, cdn2.foobar.com, cdn3.foobar.com, etc.

This approach is notable for optimizing browser page load performance. Particularly, by leveraging on the max number of default simultaneous persistent connections per server/proxy. More on this here: http://stackoverflow.com/questions/985431/max-parallel-http-connections-in-a-browser

For most Ember-CLI applications, loading the 4 main assets (vendor.css, vendor.js, client.css and client.js) is enough. And in most cases, a single fingerprint URL is sufficient. In other scenarios/apps, there are other assets to consider. Such as fonts, etc.

Perhaps it would be a good option to somehow support multiple URL's?

rickharrison commented 9 years ago

Yes, how would you envision supporting this? Using a pool of options to randomly assign? or assign certain prepend's to certain file extensions?

krzkrzkrz commented 9 years ago

I guess the former might work. As long as the assets don't stick with the same single URL

rickharrison commented 9 years ago

Would you be interested in working on a pull request to add this functionality?

rickharrison commented 8 years ago

I'm going to close this for now. If someone needs this for their own app they could implement a quick plugin to find/replace their prepend option with their more custom needs.