Dojo on CDN and Native Installation

I use quite a lot of Dojo, but so far I have only used it with a CDN like AOL / Google.

Are there any advantages to hosting a copy of Dojo rather than using it via CDN? I do not need to change the code base, but I believe there are other advantages / disadvantages?

+4
source share
4 answers

by posting your own Dojo env. for example, you can create a custom dojo assembly. Therefore, you only need to download one * .js file. This saves the traffic used by xhr requests.

-jstr

+6
source

The disadvantage of posting something from the outside is that you do not control it. You won’t get it with the Google / AOL CD / CD, but you can land with the same problem as BootyCall when using Doug Crockfords json.js from his site. http://ajaxian.com/archives/doug-crockford-and-the-online-booty-call-saga

Advantange is that you do not need to pay for bandwidth and will be constantly added to it all the time

+1
source

+1 for custom build.

We use Dojo in a product that does not guarantee Internet access, so we ship with Dojo in-built as part of our product.

0
source

Is it impossible to combine the two approaches? I tried setting my dojoConfig to the following baseUrl // ajax.googleapis.com / ajax / libs / dojo / 1.8.3 /, and at the same time, the script tag points to a custom dojo build file. The problem is that when loading custom dojo.js, NLS files (e.g. dojo_en-US.js) do not load. Could not find workaround.

As I can see, as long as the deployment environment is open for CDN, this would be the best solution for several reasons (as others have already pointed out): 1. Custom dojo reduces XHR and improves performance 2. In case the custom assembly is incomplete (who I added a request), XHR is served much faster 3. There are resources (for example, images) that cannot be embedded in the user assembly, and therefore downloading them from the CDN is preferable 4. Packaging and deploying the application is much faster because it should contain only file dojo.js, not all resources dojo release.

I would be happy if someone could prove to me their mistake and tell me how I can combine the two approaches.

Thanks Lior

0
source

All Articles