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.

jQuery CDN having SSL issues

61 pointsby _sfvdabout 7 years ago

16 comments

Someone1234about 7 years ago
It is too bad that the HTML standard has no built in way to fallback.<p>They&#x27;ve added a cryptographic hash&#x2F;integrity and the async&#x2F;defer attributes to the script tag, but something as essential as a fallback if a script or stylesheet fails to load (which the browser is best placed to know), has no built in functionality.<p>Instead you&#x27;re left doing JavaScript tricks which for missing CSS gets a little ugly[0]. But CDN with local fallback (or visa versa) has been common now for decades but yet no official support at all. Honestly if the integrity attribute is specified the browser should just be able to fall back to a cached copy it has (e.g. jquery.1.2.3.min.js has a crypto hash of ABC123, and I have that file already).<p>[0] <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;7383163&#x2F;how-to-fallback-to-local-stylesheet-not-script-if-cdn-fails" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;questions&#x2F;7383163&#x2F;how-to-fallback-...</a>
评论 #16880249 未加载
评论 #16880297 未加载
评论 #16880284 未加载
评论 #16880026 未加载
jakobdaboabout 7 years ago
I always self-host my JS&#x2F;CSS libraries: the connection is already open (thanks to keep-alive) so what&#x27;s the problem of serving a couple of more KiBs of compressed data instead of making an additional DNS request and a new connection to a CDN?<p>I understand that the CDN version of the library may have already been cached by the browser while visiting other websites, but does it really save that much time&#x2F;traffic compared to self-hosting?
评论 #16880106 未加载
评论 #16880171 未加载
keaneabout 7 years ago
<p><pre><code> Original, jQuery CDN: https:&#x2F;&#x2F;code.jquery.com&#x2F;jquery-X.Y.Z.min.js Google: https:&#x2F;&#x2F;ajax.googleapis.com&#x2F;ajax&#x2F;libs&#x2F;jquery&#x2F;X.Y.Z&#x2F;jquery.min.js Microsoft: https:&#x2F;&#x2F;ajax.microsoft.com&#x2F;ajax&#x2F;jquery&#x2F;jquery-X.Y.Z.min.js Microsoft ASP.NET: https:&#x2F;&#x2F;ajax.aspnetcdn.com&#x2F;ajax&#x2F;jquery&#x2F;jquery-X.Y.Z.min.js jsDelivr: https:&#x2F;&#x2F;cdn.jsdelivr.net&#x2F;npm&#x2F;jquery@X.Y.Z&#x2F;dist&#x2F;jquery.min.js cdnjs: https:&#x2F;&#x2F;cdnjs.cloudflare.com&#x2F;ajax&#x2F;libs&#x2F;jquery&#x2F;X.Y.Z&#x2F;jquery.min.js Yandex.ru: https:&#x2F;&#x2F;yastatic.net&#x2F;jquery&#x2F;X.Y.Z&#x2F;jquery.min.js</code></pre>
评论 #16880268 未加载
nwah1about 7 years ago
Great opportunity to strip out unnecessary uses of jQuery, and move to vanilla javascript.<p><a href="http:&#x2F;&#x2F;youmightnotneedjquery.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;youmightnotneedjquery.com&#x2F;</a>
评论 #16879986 未加载
评论 #16879906 未加载
guessmynameabout 7 years ago
Years ago, I used to link the library from Google [1] or CloudFlare [2].<p>Nowadays, with all the Node.js stuff that goes around modern front-end, I don&#x27;t see the point of embedding a JavaScript library from a CDN, unless that library is dependent on a remote service, e.g. Google Analytics, Google Maps, etc… That being said, if you are still maintaining a legacy website that depends on jQuery, you should consider to embed the library like this instead:<p>&lt;script&gt;window.jQuery || document.write(&#x27;&lt;script src=&quot;&#x2F;js&#x2F;jquery.min.js&quot;&gt;&lt;\&#x2F;script&gt;&#x27;)&lt;&#x2F;script&gt;<p>[1] <a href="https:&#x2F;&#x2F;developers.google.com&#x2F;speed&#x2F;libraries&#x2F;" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;speed&#x2F;libraries&#x2F;</a><p>[2] <a href="https:&#x2F;&#x2F;cdnjs.com&#x2F;libraries&#x2F;jquery" rel="nofollow">https:&#x2F;&#x2F;cdnjs.com&#x2F;libraries&#x2F;jquery</a>
评论 #16880120 未加载
908087about 7 years ago
One more reason to use Decentraleyes.<p><a href="https:&#x2F;&#x2F;decentraleyes.org" rel="nofollow">https:&#x2F;&#x2F;decentraleyes.org</a>
评论 #16883405 未加载
Murrawhipabout 7 years ago
It&#x27;s not an expiry. It&#x27;s a cert name mismatch. CN is *.ssl.hwcdn.net
评论 #16879998 未加载
评论 #16879831 未加载
jimaekabout 7 years ago
<a href="https:&#x2F;&#x2F;www.jsdelivr.com" rel="nofollow">https:&#x2F;&#x2F;www.jsdelivr.com</a> is a good alternative. We actually monitor for https failures and automatically remove the problematic CDN.
leepowersabout 7 years ago
This is why you self-host all project dependencies.
评论 #16879962 未加载
kreitjeabout 7 years ago
Looks like it&#x27;s working again.
justindocantoabout 7 years ago
Starting to see complaints, questions, etc. on twitter about it too.<p><a href="https:&#x2F;&#x2F;twitter.com&#x2F;search?f=tweets&amp;q=jquery" rel="nofollow">https:&#x2F;&#x2F;twitter.com&#x2F;search?f=tweets&amp;q=jquery</a>
dusan76about 7 years ago
Looks like its working now <a href="https:&#x2F;&#x2F;code.jquery.com" rel="nofollow">https:&#x2F;&#x2F;code.jquery.com</a>
rharbabout 7 years ago
Potentially related to the Chrome 66 update and Symantec stuff?
评论 #16879744 未加载
8bitbenabout 7 years ago
Yep, this just broke my project :&#x2F;
campuscodiabout 7 years ago
Looks like they fixed it
petraeusabout 7 years ago
Only hobby websites would host jquery off a cdn