> ## Content Index
> Fetch the complete content index at: https://www.albert-yu.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Aliyun Cloud 全站加速(DCDN)設定說明
- URL: https://www.albert-yu.com/blog/aliyun-dcdn-setup/
- Published: 2019-04-30T12:11:43.000Z
- Updated: 2026-10-30T03:43:25.000Z
- Author: Albert Yu
- Tags: Alibaba, Cloud, Aliyun, Aliyun Cloud, CDN, DCDN, 網站加速, 阿里雲, 預熱

## 尋找全站加速(DCDN)並新增至快捷

登入Aliyun Cloud 後點選左上角的圖示 展開選單並點選品與服務後輸入關鍵字

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-01.png)

填入『DCDN』後點選下方的全站加速即可進入服務，也可以在這邊點選文字旁的星號將服務加入快捷

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-02.png)

## 服務開通

服務開通可參考 [服務開通](https://help.aliyun.com/document%5Fdetail/64926.html?spm=a2c4g.11186623.6.553.5f1b1fc1MJwaU0&ref=albert-yu.com)

## 基礎介面說明

1. 基礎功能選項
2. 昨日流量統計
3. 計費方式，可參考 [计费方式](https://help.aliyun.com/document%5Fdetail/64923.html?ref=albert-yu.com)、[地區流量計費表](https://cn.aliyun.com/price/product?spm=a2c4g.11186623.2.13.6bc44d44awMqMW&ref=albert-yu.com#dcdn/detail)
4. 域名數統計與刷新預熱快捷

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-03.png)

## 新增域名

官方文件可參考 [添加加速域名](https://help.aliyun.com/document%5Fdetail/64927.html?spm=a2c4g.11186623.6.554.33f32120E8rTOA&ref=albert-yu.com)，限制條件可參考該連結。

點選域名管理後點選新增域名

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-04.png)

1. 加速域名：為實際上要對外服務的域名
2. 源站信息(OSS):OSS為Aliyun Cloud 的儲存服務，如果有大量靜態圖片資源可以拆分至
3. 源站信息(IP&源站域名):設定原站點IP或者是域名，如果有多個原站點IP或URL，优先级設定可參考連結 [多源优先级](https://www.alibabacloud.com/help/zh/doc-detail/65091.htm?ref=albert-yu.com) 以及後篇『全站加速回源如果有問題時的解決方案以及異常切換做法』中的說明
4. 端口：DCDN節點到您的伺服器連接時是HTTP(80) or HTTPS(443)
5. 加速区域：分三大類，由上至下分別為『純中國』『全球節點(中國+中國之外的地區)』『中國之外』，只要有選含中國就會需要icp備案。如果需要申請備案可參考此連結 [ICP支援服務](https://www.alibabacloud.com/tc/icp?ref=albert-yu.com) 或者是洽詢 Microfusion宏庭科技 的阿里雲業務部門

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-05.png)

填寫完畢之後即可點選下一步

如果有選擇到中國區的DCDN解析就會出現下列畫面，如果您的域名沒有備案。審核就不會通過。審核時間約為5分鐘到1天，通常數分鐘內就可以審核完成。

可直接點選『返回域名列表』回到DCDN頁面

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-06.png)

審核完成後再域名列上即會顯示『正常运行』

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-07.png)

## 詳細設定

如果要針對全站加速進行較細部設定可以點下配置進行更詳細的設定

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-08.png)

  
![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-09.png)

### 基本配置

在這邊可以隨時修改原站點設定及多源优先级設定

設定同新增域名時的設定

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-10.png)

### 回源配置

這邊設定上比較重要的地方是回源HOST

如果沒有設定回源DCDN訪問您的伺服器時是使用DCDN提供給您Cname的URL

建議一定要開啟

其他設定則是依照需求在行開啟

[說明連結](https://www.alibabacloud.com/help/zh/doc-detail/65088.htm?spm=a2c63.p38356.b99.23.537912ffYr0wsM&ref=albert-yu.com)

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-11.png)

### 動靜態加速規則

此規則是預設開啟的

但是並不是所有資源都是預設快取

建議在『静态文件类型』中修改配置

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-12.png)

### 緩存配置

設定『動靜態加速規則』的資源過期時間

可針對各種不同資源進行個別設定

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-13.png)

### HTTPS配置

如果前端是要提供https的服務需要在這邊開啟並上傳證書

須注意證書儘量不要買台灣發的，TWCA被中國認定是半政府組織，證書鏈在中國無法認證，會導致客戶端證書失效

http2建議開啟，但是如果您介意0.1%的客戶是老舊電腦不能訪問，建議不要使用因為太過老舊的瀏覽器會不支持http2

强制跳转依需求開啟如果開啟會自動將http以302轉至https

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-14.png)

### 訪問控制

裡面有三大功能依需求設定

1. IP黑白名单：直接限制USER端是否能訪問 [說明連結](https://www.alibabacloud.com/help/zh/doc-detail/65107.htm?spm=a2c63.p38356.b99.41.15dd1a81si59Oj&ref=albert-yu.com)
2. Referer防盗链：設定是否只有在該網站才能瀏覽[說明連結](https://www.alibabacloud.com/help/zh/doc-detail/65105.htm?spm=a2c63.p38356.b99.42.7f5912ffmxnlpY&ref=albert-yu.com)
3. URL鉴权：因Referer防盗無法完全防範的進階做法，只有在限制瀏覽器是該url的狀況資下才將資源吐出 [說明連結](https://www.alibabacloud.com/help/zh/doc-detail/65106.htm?spm=a2c63.p38356.b99.43.5b0448ceo87jOy&ref=albert-yu.com)

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-15.png)

### 性能優化

透過Aliyun AI的技術針對網站資源進行頁面資源的優化

建議選項都開啟

如果頁面中有資源是透過程式以變數的方式呈現

需再過濾參數中進行額外設定

[過濾參數說明](https://dcdn.console.aliyun.com/domain/detail/test-url-001.ixwdv.com/perform?ref=albert-yu.com)

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-16.png)

### Websocket

預設是不支持Websocket，如果需要支持只要進到該畫面打開即可

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-17.png)

## 快取資源『預先』進行快取

這個功能是屬於Aliyun Cloud中的特殊功能

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-18.png)

進入畫面後下拉選擇『操作类型』項目中的預熱，『刷新类型』因只有一個選項不用選擇

在下方的輸入完整的路徑即可將資源預先快取至CDN個節點

這可在各種網路活動之前先進行

以避免突發流量的產生

詳細設定可參考連結 [刷新与预热](https://www.alibabacloud.com/help/zh/doc-detail/64936.htm?spm=a2c63.p38356.b99.50.66815ab7psyBs7&ref=albert-yu.com)

![](https://www.albert-yu.com/content/images/2026/10/aliyun-cloud-quan-zhan-jia-su-dcdnshe-ding-shuo-ming-19.png)

如果需要API的方式進行設定可參考 [API参考 刷新预热接口 PreloadDcdnObjectCaches](https://www.alibabacloud.com/help/zh/doc-detail/89685.htm?spm=a2c63.p38356.879954.6.3d2a7c19q7Yi6J&ref=albert-yu.com)

## 全站加速回源如果有問題時的解決方案以及異常切換做法

如果您的原站點在中國之外即有可能遇到該問題

該問題可以拆解成3個部分

1. 全站加速如果連接不到原站時如何偵測
2. 第一點問題發生時如何切換
3. 改善全站加速到中國之外被牆之問題

針對第一二點可以使用『设置多源优先级』可以達到偵測以及自動切換之目的

1. 進入全站加速的域名管理並點選配置  
!\[\](https://www.albert-yu.com/wp-content/uploads/2019/04/螢幕快照-2019-04-22 19.37.46.png)
2. 點選修改配置  
!\[\](https://www.albert-yu.com/wp-content/uploads/2019/04/螢幕快照-2019-04-22 19.42.59.png)
3. 進入『源站配置』點選添加增加域名或者是IP
4. 新增完畢後點選確認

該設定有幾個注意事項

- 『主』站點如果是複數個，只要其中一個站點出現3次健康檢查失敗即時會全部導向『備』
- 每次健康檢查間隔5秒，所以如果節點發生問題最長回復正常時間為15秒。(健康檢查頻率不可變)
- OSS無法設定『主』『備』
- 建議設置為『主』『備』各一個，環境上會較為單純
- 切換不影響已預熱之資源（預熱為預先快取）

第三點得問題非常不好處理，基本上官方的長城誤檔的狀況非常嚴重，除了用第一二點的處理方式之外可以購買CN2線路，CN2線路是屬於特殊線路及即使放在香港路由可用性以及被檔都有極大的改善。