3 ms·
While true, it’s would not spread that easily. Google returns in its response header of e.g. jquery: "Expires:Fri, 21 Nov 2014 00:46:46 GMT" As long as this fi
by Jakob 13y ago
While true, it’s would not spread that easily. Google returns in its response header of e.g. jquery: "Expires:Fri, 21 Nov 2014 00:46:46 GMT"
As long as this file is in my cache, my browser won’t request it again for a year, independent what happened to it in the meantime.
> or not suffer service interruption
Preventing that is actually quite easy
<script src="//cdn/jquery.js"></script>
<script>window.jQuery || document.write('<script src="local/jquery.js">\x3C/script>')</script>
(a slightly more complex solution would be needed if the CDN is timing out instead of return an error)
- wreegab 13y agoIf it is in the cache, why is the CDN needed anyways?
- gcb1 13y agoalso, if it was not... now the malicious one is. forever.
- wcdolphin 13y agoUsing a centralized cdn would increase the chance of a cache hit.
- wreegab 13y agoI'm completely skeptical about the benefit of CDNs to users. I would like to see some hard data about the number of web sites a user visit typically to understand how this is a meaningful argument. As of now, I lean toward thinking these CDNs are just yet another way to track users. Anyways, I block them all by default, and my browsing works just fine.
- robszumski 13y agoThe main benefit isn't any of this "cached forever" business, although thats great. It's the fact that the download is coming from 1 or 2 hops away instead of all the way across the country or world.
- hercynium 13y agoHow do you "block" a CDN? Is that a mis-wording? Do you have some means to automatically discover and detect the origin servers and connect directly to them, bypassing the CDN? And, to answer your question, the benefits are substantial, well-documented, and provable on multiple levels. First off, a CDN (when working properly) greatly improves the average latency for browsing a site, and in some cases even the bandwidth usage. Additionally, use of a CDN can increase the number of users a site can simultaneously serve. The best CDNs can not only withstand but actively deflect various types of DOS attacks. Some can even serve resources like images and video dynamically optimized for the browsing software or device. There are many more benefits, and believe it or not, a huge percentage of the Internet's web and media traffic flows through CDN services - bypassing all of them is near-impossible (unless you somehow don't use any of the most popular sites and services)
- julien_c 13y agoIn my experience, browsers don't cache things very aggressively. You'll re-download that file way before 2014.