TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

My fight against CDN libraries

298 pointsby agateauover 8 years ago

23 comments

mstaoruover 8 years ago
I only represent about 0.00000013% of all Chinese Internet users, but let me chime in: EVERY website that uses Google CDNs for js or fonts just doesn&#x27;t work here. It just keeps loading and loading, and loading forever. In most cases it&#x27;s jQuery, and in most cases it&#x27;s in the &lt;head&gt; so the page just never shows. Cloudflare (cdnjs), Amazon CDNs, Akamai CDNs also occasionally get blocked and take entire Internet segments with them.<p>If you use 3rd party CDNs, please consider implementing client-side failover strategy so you don&#x27;t leave out 50% of the Internet &quot;population&quot;.
评论 #13077119 未加载
评论 #13077797 未加载
评论 #13078258 未加载
评论 #13077624 未加载
评论 #13077975 未加载
评论 #13078543 未加载
评论 #13080132 未加载
评论 #13080225 未加载
评论 #13077525 未加载
评论 #13077698 未加载
评论 #13083044 未加载
评论 #13077646 未加载
评论 #13078544 未加载
a3nover 8 years ago
Firefox on Linux.<p>I use uBlock Origin, Ghostery and Disconnect, and Flash Control. peppercarrot.com is all zeroes for all three blockers, meaning nothing is blocked because there&#x27;s nothing noticed that needs to be blocked. There are no Flash Control icons, meaning no video or audio noticed and blocked. Thanks for caring. :)<p>On the front page of theguardian.com, logged in as me, there&#x27;s a <i>V</i> icon at the top, meaning that Flash Control has blocked video, probably for some gratuitous menu feature. I have zero trouble using and reading the site.<p>When I first opened theguardian a few minutes ago, uBlock was blocking 13 requests. It&#x27;s steadily climbed in those minutes to 32 blocked requests. Ghostery is noticing&#x2F;blocking 0 trackers. Disconnect is blocking two: nielsen and comscore. Disconnect is also blocking 1 from Facebook and 3 from Google. All three tools may be seeing and blocking some of the same things.<p>Without these four tools, except for low&#x2F;no-commercial technical sites and public service sites like wikipedia my web is all but unusable. With them my web is fine.<p>I very rarely have any problems using any site. I had to enable my bank in uBlock to use their popup bill pay feature. I think I had trouble viewing a cartoon at The New Yorker; I forget what I did to view it. Youtube and Flash Control seem to be in a perpetual arms race, as was the case with Flashblock. Youtube is my main motivation for using Flash Control, to prevent automatic video playing.<p>And yep, I get that sites pay the bills with ads. I $ubscribe to three news sites, and I also get that that doesn&#x27;t pay the whole bill. The web is either going to have to block me for using a blocker (I&#x27;ve been seeing that very rarely recently, or at least &quot;Unblock us please&quot;) or figure out a less dangerous, intrusive and loadsome way to serve ads. (And yep, I just made up the word &quot;loadsome.&quot; I can do anything!)<p>EDIT: I whitelist duckduckgo.com in uBlock.<p><a href="https:&#x2F;&#x2F;duck.co&#x2F;help&#x2F;company&#x2F;advertising-and-affiliates" rel="nofollow">https:&#x2F;&#x2F;duck.co&#x2F;help&#x2F;company&#x2F;advertising-and-affiliates</a><p><a href="https:&#x2F;&#x2F;duckduckgo.com&#x2F;privacy" rel="nofollow">https:&#x2F;&#x2F;duckduckgo.com&#x2F;privacy</a>
评论 #13079200 未加载
评论 #13078444 未加载
评论 #13079815 未加载
评论 #13082689 未加载
评论 #13078718 未加载
mark242over 8 years ago
From the post:<p>&quot;Well a big one: Privacy of the readers of Pepper&amp;Carrot.&quot;<p>Before even thinking about tossing things like Google Fonts or AddThis or whatever, the very first thing you need to do is turn on HTTPS. If you&#x27;re concerned about privacy, or content injection, or MITM attacks, or name-your-poison-here, you must immediately only serve up pages via HTTPS with strong encryption.
评论 #13075941 未加载
评论 #13076042 未加载
评论 #13075928 未加载
hhsnopekover 8 years ago
The only issue with going against the grain here if you&#x27;re not putting your site itself behind a cdn. It&#x27;ll vary in download rates across the global. This was the intended use case for CDNs, but analytics are added so CDNs can improve.<p>You&#x27;re correct with the fact that they are tracking us, but there&#x27;s a trade off that comes with this that holds tremendous value. If that value of speed isn&#x27;t a factor or low on your list of priorities then by all means, sever everything.
评论 #13075645 未加载
评论 #13075650 未加载
评论 #13075696 未加载
评论 #13075598 未加载
评论 #13075634 未加载
cagenutover 8 years ago
This post and half the comments are killing me on conflating &quot;third party javascript&quot; with &quot;CDN&quot;.
评论 #13076007 未加载
beardogover 8 years ago
The code injection problem can often (but not always) be solved via Subresource Intergrity <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Security&#x2F;Subresource_Integrity" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;Security&#x2F;Subres...</a>
smnscuover 8 years ago
After working at an encrypted&#x2F;private email service, this is my cup of tea. However, I&#x27;d like to go off-topic and point out that the comic looks fantastically well drawn: <a href="http:&#x2F;&#x2F;peppercarrot.com&#x2F;en&#x2F;article383&#x2F;episode-19-pollution" rel="nofollow">http:&#x2F;&#x2F;peppercarrot.com&#x2F;en&#x2F;article383&#x2F;episode-19-pollution</a>
评论 #13075757 未加载
vbezhenarover 8 years ago
CDN is common enough technique which should be standardized in browsers. HTML should include link to resource hosted by site and its checksum. Now browser can easily use cached resource from any other site with the same checksum or just download it from site.<p>There are 2 reasons to use CDN. First is caching (different sites using the same resource from the same CDN will download it only once), second is speed (some browsers restrict connection count to the same domain, so hosting resources on a different domains might improve download time). Caching is better solved by using checksum as a key, instead of URL. Speed with HTTP&#x2F;2 is not an issue, because there&#x27;s only one TCP connection. The only advantage of CDN might be geographically distributed servers, so user from China would download resource from China server instead of US server. I don&#x27;t see easy and elegant way to solve it, but I&#x27;m not sure it should be solved at all, HTTP&#x2F;2 pushing resources should be enough.
评论 #13079146 未加载
jonchangover 8 years ago
I use Decentraleyes to help with the CDN issue. It&#x27;s not much but every little bit helps I think.<p><a href="https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;decentraleyes" rel="nofollow">https:&#x2F;&#x2F;addons.mozilla.org&#x2F;firefox&#x2F;addon&#x2F;decentraleyes</a>
kakarotover 8 years ago
I use uMatrix and do not load external web fonts. I am stripping out CDN reliance in our stack at work as well. This practice of supporting secure protocols but still trading ease-of-development for end-user privacy &amp; security must stop.
blauditoreover 8 years ago
Maybe I&#x27;m missing something crucial, but why not just host the content on your own server? I.e., just download that Google font, jquery.js or FontAwesome and serve it directly instead of using an external CDN.<p>The post seems to say &quot;I don&#x27;t like where some content is coming from, so I re-created said content by myself&quot;.
评论 #13078999 未加载
评论 #13079010 未加载
评论 #13079003 未加载
JoshTriplettover 8 years ago
Great to see someone paying attention to the problem of loading third-party &lt;script&gt;s, and talking about the work required to avoid them.
评论 #13076036 未加载
评论 #13076317 未加载
splitbrainover 8 years ago
It&#x27;s awesome that nearly 10 years after I came up with MonsterID, it&#x27;s still going strong. I love those cats.
tscs37over 8 years ago
Why use alternatives?<p>You can download the Google Web Fonts and serve them from your host.<p>You can also download and serve Font Awesome from local.<p>And there doesn&#x27;t seem to be a reason why you can&#x27;t do it with gravatar either.<p>I don&#x27;t get this post honestly. It seems to be about replacing stuff with other stuff instead of replacing CDN with locally served content.
madeofpalkover 8 years ago
Good. Another reason not to use these CDNs is they&#x27;re additional risk and introduce the potential for downtime and breakage. It&#x27;s an additional point of failure that just doesn&#x27;t come with many benefits.<p>I&#x27;ll happily use these services for quick POCs and throwaway demos, but once anything starts to become semi-permanent I&#x27;ll make sure I control my uptime and host these assets myself.
评论 #13077128 未加载
dillondoyleover 8 years ago
AddThis makes money by selling 3rd party audience segments to advertisers like me. I assume they get this data by tracking what users view what pages through their sharing buttons. Example segments I can buy to advertise too: <a href="http:&#x2F;&#x2F;i.imgur.com&#x2F;JF6ZZPC.jpg" rel="nofollow">http:&#x2F;&#x2F;i.imgur.com&#x2F;JF6ZZPC.jpg</a><p>The author doesn&#x27;t even mention the big players: every FB share or like button, on all that nasty porn you watch (even in incognito mode), straight to FB. They recently changed their policies and signaled that they are going to start using this data for ad targeting, probably in a push to expand FAN and be more competitive with Google.<p>Something as simple as a share button that some blogger copy and pasted into their blog turned into an ad tech&#x2F;data company!<p>I personally love that story and think that&#x27;s cool and innovative thinking from AddThis.<p>But I also think more data = better ads, at the expense of privacy (probably not a popular opinion around here).
brianzelipover 8 years ago
Off topic, but the root site of this blog post is pretty awesome - &quot;Pepper &amp; Carrot: A free, libre and open-source webcomic supported directly by its patrons to change the comic book industry!&quot;
thinkMOARover 8 years ago
Wonder if there will be a time CDNs of these will pay you for the visitor data you &#x27;share&#x2F;leak&#x27; with them via the linked resources (to convince you to keep using them).
WildGreenLeaveover 8 years ago
I really like CDNs because of the ability to drop in a file and know it will be cached correctly. (Also there is a high probability that your user already has a cached version of the file) But never thought about CDNs being able to track you.<p>Isn&#x27;t there an alternative? A more transparant way to provide users with source files and still keep the &#x27;cached items&#x27; aspect.
ludwigvanover 8 years ago
In the case of Google fonts, is it legally possible to download the font and serve it from one&#x27;s own server? The FAQ has a relevant section, but does not answer this question: <a href="https:&#x2F;&#x2F;developers.google.com&#x2F;fonts&#x2F;faq" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;fonts&#x2F;faq</a>
评论 #13079162 未加载
评论 #13079141 未加载
bandramiover 8 years ago
So, here&#x27;s where I mark myself as a dinosaur: why are you trying to set a specific font for a web page? Clients select fonts for a reason.
评论 #13079599 未加载
评论 #13079635 未加载
评论 #13079665 未加载
nitwit005over 8 years ago
The cats are pretty nice.
olegkikinover 8 years ago
So your main argument is privacy, not letting Google collect users&#x27; data, but then consider that most of your users are probably using Chrome, everything they type in the URL box is sent to Google (for autocompletion) anyway.<p>Is looking at some comics website even a privacy problem? Let&#x27;s say google finds out your user X looks at your website. What possible damage can they do? Sell it to the advertisers so they can target X with some comics ad? If you ran a medical site, I would get it.<p>Then you have to give up other cool things like Google Analytics.<p>P.S.<p>Some beautiful artwork on your site.
评论 #13075698 未加载
评论 #13076165 未加载
评论 #13075632 未加载
评论 #13075704 未加载
评论 #13075830 未加载
评论 #13075585 未加载
评论 #13079473 未加载
评论 #13079041 未加载
评论 #13075668 未加载