TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Cdnjs - the missing cdn

88 点作者 thomasdavis将近 14 年前

8 条评论

overshard将近 14 年前
This seems to once again miss the point. The main point of a CDN is to speed up delivery of content. Having all of these different CDNs only increases the time it takes because you are adding in more DNS queries to the client and on top of that they are adding HTTPs support which even further increases load time because of the "handshake" that goes on. That being said, if this CDN is the only one you are using then great, that works out fine. But a CDN dedicated to only Javascript just seems kind of silly other than for passing aound example HTML files for how to code something.<p>EDIT: Also another pitfall is that you can't compress all your JS into one big JS file saving time on requests too.
评论 #2828714 未加载
评论 #2830110 未加载
评论 #2828910 未加载
评论 #2829212 未加载
评论 #2828758 未加载
评论 #2828743 未加载
pbreit将近 14 年前
Pro tip: leave off the protocol to support both http and https. Example:<p>&#60;script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.6.2/jquery.min.js"&#62;&#60;/script&#62;<p>Source: <a href="http://html5boilerplate.com/" rel="nofollow">http://html5boilerplate.com/</a>
评论 #2829057 未加载
评论 #2829406 未加载
phleet将近 14 年前
I might be alone here - but I would never use a CDN that isn't back by a company with a strong vested interest in preventing security breaches of their servers.<p>Consider that the community CDN is compromised - if that file gets replaced with a different JS file, you've now provided an attacker an XSS hole into _every_ page using the CDN.<p>I have a reasonable trust in Google to secure their own servers against such a compromising attack, but have no similar reason to put faith in smaller companies/services.
evmar将近 14 年前
Note that &#60;script src&#62;'ing from some random website means that site can XSS you any time it wants to. (I'm not saying the owners intend for this; a third party could just as well hack their site and do the same.)
nikcub将近 14 年前
you should host this on a separate domain because your clients are setting cookies on your domain and when I hit one of your hosted js files I see all of those cookies<p>for eg. I can see techcrunch and metric fuckton of google analytics cookies<p>separate this from the cloudfront clients or you have a potential security problem and a definite privacy breach
pbreit将近 14 年前
Kudos on the recently added https support. And on CloudFlare now (vs Amazon)...interesting.
评论 #2830094 未加载
rkalla将近 14 年前
Really like the idea of this community driven cdn.
ch0wn将近 14 年前
Are there any statistics regarding the reliability and speed from different locations?
评论 #2828681 未加载
评论 #2828737 未加载