-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcdn.html
More file actions
16 lines (16 loc) · 11.6 KB
/
cdn.html
File metadata and controls
16 lines (16 loc) · 11.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
<!doctype html><html lang=en><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1"><title>Cdn - Frank Wang's Coding World</title><meta name=renderer content="webkit"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1"><meta http-equiv=Cache-Control content="no-transform"><meta http-equiv=Cache-Control content="no-siteapp"><meta name=theme-color content="#f8f5ec"><meta name=msapplication-navbutton-color content="#f8f5ec"><meta name=apple-mobile-web-app-capable content="yes"><meta name=apple-mobile-web-app-status-bar-style content="#f8f5ec"><meta name=author content><meta name=description content="Recommended several commonly used CDN public libraries, front-end CDN public libraries, CDN acceleration"><meta name=keywords content="Front-end CDN public library,CDN acceleration"><meta name=generator content="Hugo 0.157.0 with theme even"><link rel=canonical href=http://frankwang0909.github.io/cdn.html><link rel=apple-touch-icon sizes=180x180 href=/apple-touch-icon.png><link rel=icon type=image/png sizes=32x32 href=/favicon-32x32.png><link rel=icon type=image/png sizes=16x16 href=/favicon-16x16.png><link rel=manifest href=/manifest.json><link rel=mask-icon href=/safari-pinned-tab.svg color=#5bbad5><link href=/sass/main.min.af7fd1da18d66c2b017df5b4cae508ef44cfcac3fb4c7c7a327fe4f4f9e28b08.css rel=stylesheet><link href=/lib/fancybox/jquery.fancybox-3.1.20.min.css rel=stylesheet><meta property="og:url" content="http://frankwang0909.github.io/cdn.html"><meta property="og:site_name" content="Frank Wang's Coding World"><meta property="og:title" content="Cdn"><meta property="og:description" content="Recommended several commonly used CDN public libraries, front-end CDN public libraries, CDN acceleration"><meta property="og:locale" content="en_US"><meta property="og:type" content="article"><meta property="article:section" content="post"><meta property="article:published_time" content="2016-08-20T21:07:46+08:00"><meta property="article:modified_time" content="2016-08-20T21:07:46+08:00"><meta property="article:tag" content="CDN"><meta itemprop=name content="Cdn"><meta itemprop=description content="Recommended several commonly used CDN public libraries, front-end CDN public libraries, CDN acceleration"><meta itemprop=datePublished content="2016-08-20T21:07:46+08:00"><meta itemprop=dateModified content="2016-08-20T21:07:46+08:00"><meta itemprop=wordCount content="347"><meta itemprop=keywords content="Front-end CDN public library,CDN acceleration"><meta name=twitter:card content="summary"><meta name=twitter:title content="Cdn"><meta name=twitter:description content="Recommended several commonly used CDN public libraries, front-end CDN public libraries, CDN acceleration"><!--[if lte IE 9]><script src=https://cdnjs.cloudflare.com/ajax/libs/classlist/1.1.20170427/classList.min.js></script><![endif]--><!--[if lt IE 9]><script src=https://cdn.jsdelivr.net/npm/html5shiv@3.7.3/dist/html5shiv.min.js></script><script src=https://cdn.jsdelivr.net/npm/respond.js@1.4.2/dest/respond.min.js></script><![endif]--></head><body><div id=mobile-navbar class=mobile-navbar><div class=mobile-header-logo><a href=/en/ class=logo>Frank Wang’s Coding World</a></div><div class=mobile-navbar-icon><span></span>
<span></span>
<span></span></div></div><nav id=mobile-menu class="mobile-menu slideout-menu"><ul class=mobile-menu-list><a href=/en/><li class=mobile-menu-item>Home</li></a><a href=/en/post/><li class=mobile-menu-item>Archives</li></a><a href=/en/tags/><li class=mobile-menu-item>Tags</li></a><a href=/en/categories/><li class=mobile-menu-item>Categories</li></a><a href=/><li class=mobile-menu-item>中文</li></a></ul></nav><div class=container id=mobile-panel><header id=header class=header><div class=logo-wrapper><a href=/en/ class=logo>Frank Wang’s Coding World</a></div><nav class=site-navbar><ul id=menu class=menu><li class=menu-item><a class=menu-item-link href=/en/>Home</a></li><li class=menu-item><a class=menu-item-link href=/en/post/>Archives</a></li><li class=menu-item><a class=menu-item-link href=/en/tags/>Tags</a></li><li class=menu-item><a class=menu-item-link href=/en/categories/>Categories</a></li><li class=menu-item><a class=menu-item-link href=/>中文</a></li></ul></nav></header><main id=main class=main><div class=content-wrapper><div id=content class=content><article class=post><header class=post-header><h1 class=post-title>Cdn</h1><div class=post-meta><span class=post-time>2016-08-20</span><div class=post-category><a href=/en/categories/frontend/>frontend</a></div><span class=more-meta>347 words </span><span class=more-meta>2 mins read</span></div></header><div class=post-toc id=post-toc><h2 class=post-toc-title>Contents</h2><div class="post-toc-content always-active"><nav id=TableOfContents><ul><li><a href=#cdn>CDN</a></li><li><a href=#cdn-public-library>CDN public library</a><ul><li><a href=#advantage>advantage:</a></li></ul></li><li><a href=#recommend-several-commonly-used-front-end-public-libraries-cdn>Recommend several commonly used front-end public libraries CDN</a><ul><li><a href=#foreign>Foreign</a></li><li><a href=#domestic>Domestic</a></li><li><a href=#commonly-used-jquerycdn-at-home-and-abroad>Commonly used jQueryCDN at home and abroad:</a></li></ul></li></ul></nav></div></div><div class=post-content><h2 id=cdn>CDN</h2><p>The full name of CDN is Content Delivery Network, which is content distribution network. It refers to a computer network system that is connected to each other through the Internet. It uses the server closest to each user to send music, pictures, videos, applications and other files to users faster and more reliably to provide high performance, scalability and low-cost network content to users.</p><h2 id=cdn-public-library>CDN public library</h2><p>CDN public library refers to placing commonly used js libraries on CDN nodes to facilitate direct calls by developers. Compared with being stored on a single server, the CDN public library is more stable and faster. The general CDN public library will contain all the most popular open source JavaScript libraries in the world and can be directly referenced.</p><h3 id=advantage>advantage:</h3><ol><li>Improve access speed:</li></ol><p>Assuming that your website’s jQuery references Sina’s CDN, then when the user’s browser submits a request, the browser will automatically download the latest available file on the network, and the download speed will be faster.</p><ol start=2><li>Better caching:</li></ol><p>Many websites use several well-known CDN public libraries at home or abroad. It is very likely that many versions of jQuery have already been downloaded in the cache area of the user’s browser. When visiting your website, there is no need to download jQuery again. If you serve jQuery from your own server, your users will have to download it at least once.</p><h2 id=recommend-several-commonly-used-front-end-public-libraries-cdn>Recommend several commonly used front-end public libraries CDN</h2><h3 id=foreign>Foreign</h3><ol><li><p>jQuery: <a href=https://code.jquery.com/>https://code.jquery.com/</a></p></li><li><p>Google: <a href=https://developers.google.com/speed/libraries/>https://developers.google.com/speed/libraries/</a></p></li><li><p>CDNJS: <a href=https://cdnjs.com/libraries>https://cdnjs.com/libraries</a></p></li></ol><h3 id=domestic>Domestic</h3><ol><li><p>cdnjs: <a href=http://cdnjs.net/>http://cdnjs.net/</a></p></li><li><p>Baidu: <a href="http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs">http://developer.baidu.com/wiki/index.php?title=docs/cplat/libs</a></p></li><li><p>360: <a href=http://libs.useso.com/>http://libs.useso.com/</a></p></li><li><p>Also shoot the cloud: <a href=http://upcdn.b0.upaiyun.com/>http://upcdn.b0.upaiyun.com/</a></p></li><li><p>Sina: <a href=http://lib.sinaapp.com/>http://lib.sinaapp.com/</a></p></li></ol><h3 id=commonly-used-jquerycdn-at-home-and-abroad>Commonly used jQueryCDN at home and abroad:</h3><ol><li><p>jQuery official website: <a href=http://code.jquery.com/jquery-2.0.0.min.js>http://code.jquery.com/jquery-2.0.0.min.js</a></p></li><li><p>CDNJS: <a href=http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js>http://cdnjs.cloudflare.com/ajax/libs/jquery/2.0.0/jquery.min.js</a></p></li><li><p>Google Hosted Libraries: <a href=http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js>http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js</a></p></li><li><p>jsDeliver: <a href=http://cdn.jsdelivr.net/jquery/2.0.0/jquery-2.0.0.min.js>http://cdn.jsdelivr.net/jquery/2.0.0/jquery-2.0.0.min.js</a></p></li><li><p>Qiniu: <a href=http://cdn.staticfile.org/jquery/2.0.0/jquery.min.js>http://cdn.staticfile.org/jquery/2.0.0/jquery.min.js</a></p></li><li><p>Baidu: <a href=http://libs.baidu.com/jquery/2.0.0/jquery.min.js>http://libs.baidu.com/jquery/2.0.0/jquery.min.js</a></p></li><li><p>Sina: <a href=http://lib.sinaapp.com/js/jquery/2.0/jquery.min.js>http://lib.sinaapp.com/js/jquery/2.0/jquery.min.js</a></p></li><li><p>Also shoot the cloud: <a href=http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.0.min.js>http://upcdn.b0.upaiyun.com/libs/jquery/jquery-2.0.0.min.js</a></p></li><li><p>360: <a href=http://libs.useso.com/js/jquery/2.0.0/jquery.min.js>http://libs.useso.com/js/jquery/2.0.0/jquery.min.js</a></p></li></ol><p>Of course, after all, third-party services may not be completely reliable. If you refer to a foreign site, it may be blocked one day. So, we can add the following code, when
When the CDN fails to load, you can also load your own local jQuery file. <a href=https://paulund.co.uk/fallback-on-local-jquery-if-cdn-fails>Code source link below</a></p><pre><code><script>
</code></pre><p>window.jQuery || document.write(’’);</p></div><footer class=post-footer><div class=post-tags><a href=/en/tags/cdn/>CDN</a></div><nav class=post-nav><a class=prev href=/js-reg.html><i class="iconfont icon-left"></i>
<span class="prev-text nav-default">Js Reg</span>
<span class="prev-text nav-mobile">Prev</span>
</a><a class=next href=/seo.html><span class="next-text nav-default">Seo</span>
<span class="next-text nav-mobile">Next</span>
<i class="iconfont icon-right"></i></a></nav></footer></article></div></div></main><footer id=footer class=footer><div class=social-links><a href=mailto:frankwang0909@gmail.com class="iconfont icon-email" title=email></a><a href=https://www.twitter.com/frankwang0909 class="iconfont icon-twitter" title=twitter></a><a href=https://www.github.com/frankwang0909 class="iconfont icon-github" title=github></a><a href=http://frankwang0909.github.io/en/index.xml type=application/rss+xml class="iconfont icon-rss" title=rss></a></div><div class=copyright><span class=power-by>Powered by <a class=hexo-link href=https://gohugo.io>Hugo</a>
</span><span class=division>|</span>
<span class=theme-info>Theme -
<a class=theme-link href=https://github.com/olOwOlo/hugo-theme-even>Even</a>
</span><span class=copyright-year>©
2016 -
2026<span class=heart><i class="iconfont icon-heart"></i></span><span></span></span></div></footer><div class=back-to-top id=back-to-top><i class="iconfont icon-up"></i></div></div><script type=text/javascript src=/lib/jquery/jquery-3.2.1.min.js></script><script type=text/javascript src=/lib/slideout/slideout-1.0.1.min.js></script><script type=text/javascript src=/lib/fancybox/jquery.fancybox-3.1.20.min.js></script><script type=text/javascript src=/js/main.min.4ae89da218555efa0e7093a20b92017d2e1202b66fff9fc2edf4cb8d44b44c6e.js></script><script type=text/javascript>window.MathJax={tex:{}}</script><script async src=https://cdn.jsdelivr.net/npm/mathjax@3.0.5/es5/tex-mml-chtml.js integrity="sha256-HGLuEfFcsUJGhvB8cQ8nr0gai9EucOOaIxFw7qxmd+w=" crossorigin=anonymous></script></body></html>