顯示具有 CDN 標籤的文章。 顯示所有文章
顯示具有 CDN 標籤的文章。 顯示所有文章

2024年4月21日 星期日

[研究]ASP.NET,WebForm,常見CDN(Content Delivery Network,內容交付網路)網址

[研究]ASP.NET,WebForm,常見CDN(Content Delivery Network,內容交付網路)網址

2024-04-21

環境:Visual Studio 2022 + ASP.NET + WebForm + Web Application + C# + SQL Server 2019 + SQL Server Management Studio (SSMS) 19

********************************************************************************

ASP.NET,WebForm,請推薦常見CDN網址,愈推薦的,放愈上面。

Copilot

以下是幾個常見的 CDN(內容交付網路)服務提供商,我會按照推薦程度進行排序:

  1. Cloudflare:Cloudflare 是最受歡迎的免費 CDN 之一,並且具有出色的性能。在全球 6 大洲的測試中,Cloudflare 平均加速了移動站點的加載速度達到 43%1。它在 100 多個國家擁有 275 多個數據中心,具有出色的地理覆蓋範圍。設置非常簡單,只需將您的域名解析指向 Cloudflare 即可。此外,Cloudflare 還提供免費的 SSL、DDoS 保護和防火牆規則等功能,但高級 WAF、負載平衡和其他企業級功能需要升級計劃。
  2. BunnyCDN:BunnyCDN 是一個較不知名但優秀的免費 CDN 選項,並且不像 Cloudflare 那樣存在單點故障。在我的測試中,BunnyCDN 全球加速了移動站點的加載時間達到 29%1。雖然稍遜於 Cloudflare,但對於免費服務來說仍然非常出色。它在 6 大洲擁有 50 多個點的存在,覆蓋範圍較小但仍然可觀。設置簡單,只需添加幾個 CNAME 記錄即可。它包括免費的 SSL 和入門級 DDoS 保護,但不像 Cloudflare 那樣具有高級防火牆規則或 WAF。如果您需要一個不會因問題而使整個站點癱瘓的免費 CDN,BunnyCDN 是一個不錯的選擇,您會失去一些安全保護,但獲得內置的冗餘性。
  3. StackPath:StackPath 在價格和功能之間取得了良好的平衡,並且具有適合電子商務站點的強大安全保護。在我的測試中,StackPath 全球加速了加載時間達到 36%1。考慮到涉及的額外安全層,這是非常令人印象深刻的速度。它在 5 大洲擁有 45 多個邊緣站點,足夠大的覆蓋範圍適用於大多數情況。價格從每月 20 美元起,可獲得高達 1TB 的流量。

請根據您的需求和預算選擇適合您的 CDN 服務提供商。

The 7 Best CDN Services for 2024 (Comparison & Benchmarks),March 7, 2024
https://www.33rdsquare.com/cdn-services/#google_vignette

********************************************************************************

ASP.NET,WebForm,請推薦常見CDN網址,愈推薦的,放愈上面。
ChatGPT
當你在使用ASP.NET WebForms時,CDN(Content Delivery Network)可以幫助提高你的網站的效能和載入速度。 以下是一些常見的CDN服務供應商,你可以考慮使用:
  1. Microsoft Ajax CDN - Microsoft 提供的CDN服務,提供了 ASP.NET WebForms 的 Microsoft Ajax 程式庫和其他相關資源。https://learn.microsoft.com/zh-tw/aspnet/ajax/cdn/overview
  2. Google CDN - Google 提供了一個用於常見 JavaScript 函式庫(如 jQuery、AngularJS)的 CDN。 這些庫通常也可以用於 ASP.NET WebForms 專案。https://cloud.google.com/cdn/
  3. Cloudflare CDN - Cloudflare 是一個廣泛使用的CDN服務供應商,提供了全球效能優化和安全功能。https://www.cloudflare.com/zh-tw/application-services/products/cdn/
  4. Amazon CloudFront - Amazon 的 CDN服務,提供了高度可靠的全球內容傳遞和快取。https://aws.amazon.com/tw/cloudfront/
  5. Bootstrap CDN - 如果你在專案中使用了 Bootstrap 框架,Bootstrap 提供了自己的CDN服務,用於加速 Bootstrap 資源的加載。https://www.bootstrapcdn.com/
  6. cdnjs - cdnjs 是一個託管常見 JavaScript 庫的CDN,它提供了許多流行的庫的快速加載。https://cdnjs.com/
  7. jsDelivr - jsDelivr 是一個免費開源的CDN服務,提供了許多開源項目的資源載入。https://www.jsdelivr.com/
這些CDN服務提供了快速、可靠的內容傳遞,可幫助提高你的 ASP.NET WebForms 網站的效能。 當然,根據你的具體需求和項目配置,你可能會更偏好某些CDN服務供應商。
********************************************************************************
ASP.NET,WebForm,對於在台灣的使用者,請推薦常見CDN網址,愈推薦的,放愈上面。

Copilot

對於在台灣使用 ASP.NET Web Forms 的使用者,以下是一些常見的 CDN 網址,您可以根據推薦程度將它們放在您的網頁上:
  1. Microsoft Ajax Content Delivery Network (CDN):這是由 Microsoft 提供的官方 CDN,用於提供 ASP.NET Web Forms 中的 jQuery 和其他前端資源。
  2. Google Hosted Libraries:Google 提供的 CDN,包含了許多流行的 JavaScript 函式庫,例如 jQuery、Angular、React 等。
  3. cdnjs:這是一個社群維護的 CDN,提供了大量的前端資源,包括 CSS、JavaScript 等。
  4. jsDelivr:另一個社群維護的 CDN,支援許多流行的前端框架和函式庫。
您可以根據您的需求選擇適合的 CDN,並將它們添加到您的 ASP.NET Web Forms 專案中。
********************************************************************************
ASP.NET,WebForm,對於在台灣的使用者,請推薦常見CDN網址,愈推薦的,放愈上面。
ChatGPT
對於在台灣的使用者,以下是一些常見的 CDN(Content Delivery Network)網址,這些 CDN 在提供靜態資源(如圖片、CSS、JavaScript)時通常都具有良好的效能和可用性:
這些 CDN 都有在台灣地區部署伺服器,能夠提供更快速的資源傳送,對於提升網站的性能和用戶體驗非常有幫助。
********************************************************************************

(完)

相關

2023年3月25日 星期六

[研究]CloudFlare CDN 可以去真實 WebForm 網站下載網站到 CloudFlare CDN 成為靜態網站嗎?

[研究]CloudFlare CDN 可以去真實 WebForm 網站下載網站到 CloudFlare CDN 成為靜態網站嗎?

2023-03-25

ChatGPT:

Cloudflare CDN 可以使用其靜態網頁緩存(Static Page Caching)功能將動態網頁轉換為靜態網頁,從而提高網站的性能和速度。這是一種將網站內容複製到 CDN 的方式,以提供更快的加載速度和更佳的用戶體驗。

不過,要將真實 ASP.NET WebForm 網站下載到 CloudFlare CDN 成為靜態網站,需要先將該網站的內容轉換為靜態網頁,然後再上傳到 CloudFlare CDN。通常這是由網站管理員或開發人員完成的,而非由 Cloudflare 自動完成。因此,將 WebForm 轉換為靜態網頁需要進行一定的技術處理和設置。

(完)

2023年3月7日 星期二

[研究]CKEditor 4.x、5.x的官方 CDN 網址

[研究]CKEditor 4.x、5.x的官方 CDN 網址

2023-03-07

CKEditor官方網站
https://www.ckeditor.com/

CKEditor Ecosystem · GitHub
https://github.com/ckeditor

NuGet Gallery | ckeditor-full 4.20.2
https://www.nuget.org/packages/ckeditor-full

Quick start - CKEditor 5 Documentation
https://ckeditor.com/docs/ckeditor5/latest/installation/getting-started/quick-start.html

NuGet Gallery | ckeditor-full 4.20.2,沒有相依套件
https://www.nuget.org/packages/ckeditor-full#dependencies-body-tab

開發機、測試機,最好用NuGet安裝版,省得花時間去 Internet 下載;

正式機,用CDN版,可以節省頻寬。(前提是 Client 端可以連上 Internet )

以下是 CKEditor 的官方 CDN 網址:

https://cdn.ckeditor.com/

https://ckeditor.com/ckeditor-4/download/#ckeditor-4

<script src="https://cdn.ckeditor.com/4.20.2/standard/ckeditor.js"></script>

<script src="https://cdn.ckeditor.com/4.20.2/basic/ckeditor.js"></script>

<script src="https://cdn.ckeditor.com/4.20.2/full/ckeditor.js"></script>

https://ckeditor.com/ckeditor-5/download/#ckeditor-5

<script src="https://cdn.ckeditor.com/ckeditor5/36.0.1/classic/ckeditor.js"></script>

********************************************************************************

ASP.NET , WebForm, 當 IIS本機IPv4 為某值時,用本機已安裝的 jQuery,否則用 CDN 版 ?

您可以在ASP.NET WebForms中使用以下方法來達到您所需的效果:

在Web.config文件中定義IPv4地址的AppSetting

<appSettings>
   <add key="IPv4Address" value="x.x.x.x"/>
</appSettings>

在你的ASP.NET WebForms中添加以下程式碼:

Default.aspx.cs

<script src='<%= GetJQueryUrl() %>'></script>
<%
public string GetJQueryUrl()
{
    var ipv4Address = ConfigurationManager.AppSettings["IPv4Address"];
    var localIpAddress = HttpContext.Current.Request.ServerVariables["LOCAL_ADDR"];
    if (localIpAddress == ipv4Address)
    {
        return ResolveUrl("~/Scripts/jquery.min.js");
    }
    else
    {
        return "https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.0.min.js";
    }
}
%>

這段程式碼會檢查本機IPv4地址是否等於定義在Web.config文件中的值。如果相同,它會使用本機安裝的jQuery。否則,它會使用CDN版本的jQuery。

(完)

相關

[研究]jQuery 和 jQuery UI的 CDN 網址
https://shaurong.blogspot.com/2023/03/jquery-jquery-ui-cdn.html

[研究]Bootstrap 3.x, 4.x, 5.x的官方 CDN 網址
https://shaurong.blogspot.com/2023/03/bootstrap-3x-4x-5x-cdn.html

[研究]CKEditor 4.x、5.x的官方 CDN 網址
https://shaurong.blogspot.com/2023/03/ckeditor-4x5x-cdn.html

[研究]Bootstrap 3.x, 4.x, 5.x的官方 CDN 網址

[研究]Bootstrap 3.x, 4.x, 5.x的官方 CDN 網址

2023-03-07

Bootstrap 的官方 CDN 網址:
https://www.jsdelivr.com/package/npm/bootstrap

https://www.nuget.org/packages/bootstrap/5.2.3
點 Dependencies,5.x版沒有相依套件。

https://www.nuget.org/packages/bootstrap/4.6.1
相依 jQuery (>= 3.0.0 && < 4.0.0) 和 popper.js (>= 1.16.1 && < 2.0.0)

https://www.nuget.org/packages/bootstrap/3.4.1#dependencies-body-tab
相依 jQuery (>= 1.9.1 && < 4.0.0)

********************************************************************************

抓3.x.x版的最新版,要自己注意相依套件問題

<head>
<script src="https://releases.jquery.com/git/jquery-2.x-git.js"></script>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@3/dist/js/bootstrap.min.js"></script>

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@3/dist/css/bootstrap.min.css" rel="stylesheet" >

</head>

上面 jQuery 其實可用 3.x 版。

抓4.x.x版的最新版,要自己注意相依套件問題

<head>

<script src="https://releases.jquery.com/git/jquery-3.x-git.js"></script>

  <script src="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/js/bootstrap.min.js"></script>

  <link href="https://cdn.jsdelivr.net/npm/bootstrap@4/dist/css/bootstrap.min.css" rel="stylesheet" >

</head>

********************************************************************************

Lastest版,如果目前最新是5.2.3版,不註明版本,會抓到5.2.3版

<script src="https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.min.js"></script>

<link href="https://cdn.jsdelivr.net/npm/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">


Major,如果目前最新是5.2.3版,註明5.x版本,會抓到5.2.3版

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/js/bootstrap.min.js"></script>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css" rel="stylesheet">


Minor,如果目前最新是5.2.3版,註明5.2.x版本,會抓到5.2.3版

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2/dist/js/bootstrap.min.js"></script>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2/dist/css/bootstrap.min.css" rel="stylesheet">


Static,如果目前最新是5.2.3版,註明5.2.3版本,會抓到5.2.3版

<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.min.js"></script>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet">

********************************************************************************

Bootstrap 3.x 的頁籤,最多只能使用 jQuery 哪一版 ?

Bootstrap 3.x 的頁籤可以使用 jQuery 1.x 或 2.x 版本。這是因為 Bootstrap 3.x 是在 jQuery 1.x 和 2.x 版本的基礎上開發的,因此這些版本是相容的。但請注意,使用 jQuery 3.x 版本可能會導致一些問題,因為 jQuery 3.x 版本已經移除了一些舊有的 API,這些 API 可能被 Bootstrap 3.x 使用到。因此建議使用 jQuery 1.x 或 2.x 版本來配合 Bootstrap 3.x 的頁籤。

********************************************************************************

Bootstrap 4.x 的頁籤,最多只能使用 jQuery 哪一版 ?

Bootstrap 4.x 的頁籤可以使用 jQuery 3.x 版本。Bootstrap 4.x 是在 jQuery 3.x 版本的基礎上開發的,因此這些版本是相容的。但請注意,如果你正在升級從 Bootstrap 3.x 到 4.x,則需要更新你的 jQuery 版本,因為 Bootstrap 4.x 不再支持 jQuery 1.x 和 2.x 版本。所以,如果你想使用 Bootstrap 4.x 的頁籤,則需要使用 jQuery 3.x 版本。

********************************************************************************

Bootstrap 5.x不再相依於 jQuery。

********************************************************************************

(完)

相關

[研究]jQuery 和 jQuery UI的 CDN 網址
https://shaurong.blogspot.com/2023/03/jquery-jquery-ui-cdn.html

[研究]Bootstrap 3.x, 4.x, 5.x的官方 CDN 網址
https://shaurong.blogspot.com/2023/03/bootstrap-3x-4x-5x-cdn.html

[研究]CKEditor 4.x、5.x的官方 CDN 網址
https://shaurong.blogspot.com/2023/03/ckeditor-4x5x-cdn.html

[研究] ckeditor full, standard, basic 版的差別
http://shaurong.blogspot.com/2021/08/ckeditor-full-standard-basic.html

[研究][ASP.NET][JavaScript] ckeditor-full v4.9.2 試用(NuGet安裝)
http://shaurong.blogspot.com/2018/06/aspnetjavascript-ckeditor-full-v492.html

[研究] NuGet 安裝的 CKEditor 版本比較
http://shaurong.blogspot.com/2018/06/nuget-ckeditor.html


[研究]jQuery 和 jQuery UI的 CDN 網址

[研究]jQuery 和 jQuery UI的 CDN 網址

2023-03-07

jQuery CDN:

https://releases.jquery.com/jquery/

<script src="https://code.jquery.com/jquery-3.6.3.js" integrity="sha256-nQLuAZGRRcILA+6dMBOvcRh5Pe310sBpanc6+QBmyVM=" crossorigin="anonymous"></script>

<script src="https://code.jquery.com/jquery-3.6.3.min.js" integrity="sha256-pvPw+upLPUjgMXY0G+8O0xUf+/Im1MZjXxxgOcBQBXU=" crossorigin="anonymous"></script>

可以簡寫為

<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>

********************************************************************************

jQuery UI CDN:

https://releases.jquery.com/ui/

<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js" integrity="sha256-eTyxS0rkjpLEo16uXTS0uVCS4815lc40K2iVpWDvdSY=" crossorigin="anonymous"></script>

<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.min.js"></script>

<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css" />

https://code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css

https://code.jquery.com/ui/1.13.1/jquery-ui.min.js

https://code.jquery.com/ui/1.13.1/themes/smoothness/jquery-ui.css

********************************************************************************

非官方CDN

Google CDN:

jQuery.min.js:https://ajax.googleapis.com/ajax/libs/jquery/3.6.3/jquery.min.js

jQuery.min.css:https://ajax.googleapis.com/ajax/libs/jqueryui/1.13.2/themes/smoothness/jquery-ui.css

Microsoft CDN:

jQuery.min.js:https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.6.3.min.js

jQuery.min.css:https://ajax.aspnetcdn.com/ajax/jquery.ui/1.13.2/themes/smoothness/jquery-ui.css

********************************************************************************

(完)

相關

[研究]jQuery 和 jQuery UI的 CDN 網址
https://shaurong.blogspot.com/2023/03/jquery-jquery-ui-cdn.html

[研究]Bootstrap 3.x, 4.x, 5.x的官方 CDN 網址
https://shaurong.blogspot.com/2023/03/bootstrap-3x-4x-5x-cdn.html

[研究]CKEditor 4.x、5.x的官方 CDN 網址
https://shaurong.blogspot.com/2023/03/ckeditor-4x5x-cdn.html