4 ms·
It's not just a few milliseconds though. For example at https://starthq.com https://starthq.com, we are based in Finland, but host on Amazon in US East. A round
by olegp 13y ago
It's not just a few milliseconds though. For example at https://starthq.com https://starthq.com, we are based in Finland, but host on Amazon in US East. A round trip to the US is 200ms+ whereas with CloudFront it's 8ms. Before we used a CDN our page took a few seconds to load - now it takes around 200ms.
I should also mention that all this happens only on first load. We embed etags in the URLs and use far off cache control expires dates, so subsequent page loads get the JS and CSS from the browser's cache.
- bsimpson 13y agoI think there's confusion here about the use of the term CDN. There are public CDNs, like Google AJAX APIs, that allow a shared copy of an open-source library to be downloaded from a known-good location. This enables users to reuse the same copy their browser has already cached across multiple pages, but like romaniv and the OP have pointed out, you are then trusting Google to be good stewards of that resource. Conversely, you control what shows up on your own private CDN, like CloudFront. Sure, there may be downside outside of your control, but nobody is going to be able to alter the resources there without your permission.
- jmillikin 13y ago> Conversely, you control what shows up on your own > private CDN, like CloudFront. Sure, there may be > downside outside of your control, but nobody is going > to be able to alter the resources there without your > permission. Well, CloudFront could, since they control the machines that your users are connecting to.
- pyre 13y agoOne could say the same of any host.
- jmillikin 13y agoThat's the point; it's silly to say that https://some-cdn.com/jquery-1.9.1.min.js https://some-cdn.com/jquery-1.9.1.min.js is inherently less secure than https://my-cloudfront-proxied-site.com/jquery-1.9.1.min.js https://my-cloudfront-proxied-site.com/jquery-1.9.1.min.js
- pyre 13y agoWell, it also depends on your level of trust for Google vs. CloudFront.
- romaniv 13y agoI don't want to imply that you personally shouldn't use a CDN, but the page you linked to loads 43 files. If you consolidated, removed links to or inlined some of them, the difference with and without CDN would likely to be much smaller.
- olegp 13y agoActually the core StartHQ app is less than 10 files: the libraries and application each have their own JS and CSS files, then there's Font Awesome and a couple of images loaded by Bootstrap. The rest is one third party analytics JS file & iframes for social media sharing buttons, which don't block page rendering and we don't have control over.