Igor
Igor

Reputation: 2659

Are there any CDN that permits to customize the jquery-ui?

we've been using just a few of jquery-ui library in our service, currently the Sortable. The libraries are taken from CDN of google as this

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" ></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js" type="text/javascript" ></script>

Currently we need to optimize the client side and it seems the customization of jquery-ui is not supported by google, but it would be quite nice to have something of this type

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript" ></script>
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js?modules=core,widget,mouse,sortable" type="text/javascript" ></script>

Are there any CDN that can provide this kind of functionality you or we should host ourself version of custom library?

Thanks.

Upvotes: 0

Views: 1028

Answers (1)

acme
acme

Reputation: 14856

It actually does not make much sense using a customized CDN hosted library, at least for a library like jQuery UI which has many customization possibilites.

The purpose of a CDN like the Google CDN is mainly "to make the web faster" (as Google says, besides having a very good overview which library is used on which homepage, which is another topic). So if multiple sites all are using the same library from a CDN (with the same URL) their browser (or any proxy server) could use an already locally cached library instead of doing a full new download again.

If jQuery UI would be customizable on a CDN chances are very small that another site uses exactly the same configuration like your site, so the advance of speeding up the requests by using cached versions is simply not given.

For example, if you are using

//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js?modules=core,widget,mouse,sortable

a different set of modules or just another modules order already make a new request.

Upvotes: 2

Related Questions