Search code examples
twitter-bootstrapcdnamazon-cloudfront

Do you lose any performance by using your own cdn instead of a common one?


I'm currently trying to structure my project to get the fastest load times. I'm at a point now where I can put my CSS and JS on my own CloudFront CDN or I can use the maxcdn links for bootstrap, jquery, etc.

My initial thoughts would be that using maxcdn would be better because it would probably already be cached from other sites but, isn't that the reason for my own cdn.

Any feedback on this would be great, thanks!


Solution

  • Having a CDN was one of the biggest task in the olden days not anymore.

    In addition to using cloudfront, you can checkout webpack where it can bundle all your javascript, minify and have that as a single file. It will also reduce the number of requests it need to make to load your page.

    I addition to that enabling compression will make the file compressed automatically with CloudFront.

    Apart from all these features, you can enable Authentication, Authorization and Blacklist IP, Countries and a lot more.

    Have it in front of CloudFront will make your application safer, faster and scales as you needed.

    Hope it helps.