Hacker Newsnew | past | comments | ask | show | jobs | submitlogin



Curious what people's thoughts on using a CDN for these sorts of things (Bootstrap, JQuery etc) versus deploying it on their own sites.

It's an extra DNS query - but thoughts on overall impact on performance?


For public facing web site/blogs, everyone using the same CDN might make your page load faster because there's a good chance a visitor to your site already loaded it from a CDN. So initially I was all for using NetDNA's CDN (they maintain all versions, both css and js).

However, over time I revised my opinion. During development, it's usually nicer to have all your static files associated with the project in your project directory. There might also be a situation where you're developing offline (or crappy hotel wifi) and a failed GET just messes up your whole rhythm.

Additionally, a lot of my work is internal projects. If I'm throwing together a quick web application, or even just a static site, I use bootstrap's grid, table classes, and icon packs to make that project look nicer. But I felt that for a secure application that can only be reached while on our VPN, it didn't make sense to refer the browser to a piece of javascript running out on the internet. Even if no malicious tracking code is injected into the js, I don't need to give this third party server details like 'REFERRER=https://passwordvault.corp.example.com/?q=jsmith'.


I'm against it for stuff that is not watched like a hawk. For example Google's CDN version of jQuery is fine but I'm not going to use any other random CDN Bootstrap decided to use because I don't trust it.

When RC1 came out, the CDN version had a random dev build (90% broken) but on the page they linked to it as RC1.

I compared the downloaded version .vs CDN and the files were different.

So be careful, if company hosting CDN is not well known or has a good reputation you might screw your self.


I think the idea is that if everyone serves it from the same URL, it's cached before the user sees your page for the first time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: