Note that there are some explanatory texts on larger screens.

plurals
  1. POwhen to host using a CDN and when not to?
    primarykey
    data
    text
    <p>This question tries to find whether its worth to trade-off the benefits of a CDN in favor of a more structured and organized vendor code management.</p> <hr> <p>I know that using a CDN to deliver vendor libs like jquery is recommended. </p> <p>Yet, I was reading about <a href="http://twitter.github.com/bower/" rel="noreferrer">bower</a> today and It made me wonder. With bower I can easily manage all of the dependencies of my application in a very structured way. I can eventually pack them up in a single <code>vendor.js</code> file (using yeoman, <a href="http://brunch.io" rel="noreferrer">brunch</a> or simple <a href="http://gruntjs.com/" rel="noreferrer">grunt</a>) that will be server in the html in a <code>script</code> tag.</p> <p>However, while this approach can make my life easier, what are its cons? I can think of the following:</p> <ul> <li>There is high chance that many of the libs i'm using, are already cached in the user's browser. </li> <li>By putting it all in a single <code>vendor.js</code> file, the browser will eventually cache this file, but I will start facing problems whenever I add new third-party depencies, ie when my vendor file is changed. The browser will have to reload that file (thus loosing the caching of the original vendor.sj file)</li> </ul> <p>Putting it this way, paying the time to manage dependencies in the html as <code>&lt;script&gt;</code> tags, seams to offer a better performance/load time.</p> <p>Do you think there is something wrong in my way of thinking? Is the benefit of organizing code with say <code>bower</code>, convincing enough? After all, its like for backbone. Yes a backbone app is heavier for small applications, it contains more code.. but from a dev point of view, its worth it!</p> <p>Cheers (and thanks for the comments that made me re-edit the question!)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload