Closed lenovouser closed 9 years ago
You can also use our API to load multiple other CDNs https://github.com/jsdelivr/api
@jimaek :+1:
that seems like a great idea. But how do you handle the same script (e.g. jQuery) over multiple content delivery networks? Maybe let the users choose which cdn they want to use?
@ApfelUser Sorry im a bit confused. Are you talking about the API or jsDelivr as a CDN?
No, I am talking about the fact that e.g. jQuery is hosted on Google CDN, CDNJS, MaxCDN etc. and I hope that the user gets to choose which cdn he wants to use. JSDelivr is no CDN? I thought it is like a index for all resources on all content delivery networks
There already exists a plugin which basically does what we want, but it (sorry) looks pretty bad and has a way different concept of using it (no autocomplete, etc.) https://github.com/dnbard/brackets-cdn
For example Google http://api.jsdelivr.com/v1/google/libraries/jquery cdnjs http://api.jsdelivr.com/v1/cdnjs/libraries/jquery jsDelivr http://api.jsdelivr.com/v1/jsdelivr/libraries/jquery
Sorry, did not know that. The idea with the preference on which cdn to use seems good, but what happens when a library is not available on the chosen cdn? Sorry for my probably bad english - I am not a native speaker...
Like I said in case of this plugin you can add a settings menu to allow the user to select his preferred CDN and an alternative CDN. For example he selects google so then all requests go to http://api.jsdelivr.com/v1/google/libraries but if Google is not hosting the requested project then the plugin will use the alternative CDN.
Thats my suggestion, its up to @szdc to do what he likes :)
:+1:
Well, then let's wait util @szdc responds... :smile:
Hey guys,
Thanks for the comments! Funnily enough this was actually where I planned to take the extension next - I stumbled upon jsDelivr after finishing it last night and noticed the APIs for the CDNs.
As for preferences, building on both of your thoughts:
Thoughts? Feel free to fork and submit PRs once we agree on a general direction, I'm pretty busy over the next couple of days :smiley:
Added basic functionality 9395ce52757006bcab775f8605d43ca263686970
Hello Jack,
it would be really nice if you could include the resources from https://cdnjs.com, you can get the list over json (https://cdnjs.com/packages.json). By the way, the JSON file gets loaded way faster over SSL/HTTPS than over HTTP, I think that probably is because of SPDY. So keep that in mind...