Cache Enabler:設定簡單的 WordPress 快取外掛

聯盟行銷揭露 Ver 3.1
聯盟行銷揭露 Ver 3.2(僅限行動版)
測試環境 CloudwaysDebian 12Nginx + ApacheCache Enabler 1.8.172026-10-18 確認

在 Cloudways 伺服器的 WordPress 安裝 Cache Enabler,並以設定畫面的預設值直接啟用後,未登入請求的首位元組時間中位數從 220.9ms 縮短為 55.1ms。

WordPress 網站的外掛數量一旦超過一定程度,就可能出現 速度變慢 的現象。要找到功能與效能都令人滿意的外掛並不容易,而速度問題可能導致 訪客流失與 技術 SEO 上的不利影響。

因此,快取外掛已經成為 必備而非選項。

其中 Cache Enabler 是 KeyCDN 提供的 設定簡單的免費快取外掛,也是許多剛開始使用 WordPress 的網站管理員會選擇的外掛之一。

Cache Enabler 的啟用安裝數超過 10 萬,評分為 4.3 分(滿分 5 分),是經過驗證的快取外掛。設定頁面只有一頁,初學者也能輕鬆使用,並且只精簡地提供 HTML 壓縮、WebP 支援等核心功能。

✅ 安裝 Cache Enabler

在 WordPress 管理後台前往 [安裝外掛],搜尋 Cache Enabler 並安裝外掛。

🧭 Cache Enabler 安裝與設定模擬器
快取外掛路徑模擬器
📍Plugins›Add Plugin
安裝外掛
在搜尋欄位輸入 Cache Enabler,按下 [Install Now],安裝完成後再按 [Activate]。
📍Settings›Cache Enabler›Cache Behavior
快取行為
勾選 [Cached pages expire] 並輸入過期時間,建議間隔為 8~10 小時。
📍Settings›Cache Enabler›Cache Exclusions
快取排除
這些欄位用來輸入要從快取中排除的文章 ID、頁面路徑、查詢字串與 Cookie,設定完成後按下 [Save Changes]。
example.com/wp-admin/plugin-install.php
Add Plugins Upload Plugin
Plugins extend and expand the functionality of WordPress. You may install plugins from the WordPress Plugin Directory right on this page, or upload a plugin in .zip format by clicking the button above.
Search ResultsFeaturedPopularRecommendedFavorites
Search PluginsKeyword
162 items
Cache Enabler
Installing...ActiveMore Details
A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
By KeyCDN
★★★★★ (139)
Last Updated: 3 weeks ago
100,000+ Active Installations
✓ Compatible with your version of WordPress
example.com/wp-admin/options-general.php?page=cache-enabler
Clear Site Cache
Cache Enabler Settings
Combine Cache Enabler with KeyCDN for even better WordPress performance and achieve the next level of caching with a CDN.
Cache Behavior
Expiration
Cached pages expirehours after being created.
Clearing
Clear the site cache if any post type has been published, updated, or trashed (instead of the post cache).
Clear the site cache if a comment has been posted, updated, spammed, or trashed (instead of the comment cache).
Clear the site cache if a term has been added, updated, or deleted (instead of the term cache).
Clear the site cache if a user has been added, updated, or deleted (instead of the user cache).
Clear the site cache if a plugin has been activated or deactivated.
Versions
Create a cached version for WebP support. Convert your images to WebP with Optimus.
Create a cached version for mobile devices.
Create a cached version pre-compressed with Gzip.
Minification
Minify HTML in cached pages excluding inline CSS and JavaScript.
Cache Exclusions
Post IDs
 
Post IDs separated by a , that should bypass the cache.
Example: 2,43,65
Page Paths
 
A regex matching page paths that should bypass the cache.
Example: /^(\/|\/forums\/)$/
Query Strings
 
A regex matching query strings that should bypass the cache.
Example: /^nocache$/
Default if unset: /^(?!(fbclid|ref|mc_(cid|eid)|utm_(source|medium|campaign|term|content|expid)|gclid|fb_(action_ids|action_types|source)|age-verified|usqp|cn-reloaded|_ga|_ke)).+$/
Cookies
 
A regex matching cookies that should bypass the cache.
Example: /^(comment_author|woocommerce_items_in_cart|wp_woocommerce_session)_?/
Default if unset: /^(wp-postpass|wordpress_logged_in|comment_author)_/
Save Changes and Clear Site Cache
點選左側選單中亮起的項目或畫面上的按鈕。

✅ Cache Enabler 設定

🔲 快取行為

◻️ 過期

  • ⌛快取頁面會在建立 0 小時後過期 (0 = 不過期)
  • ↳ 建議以 8~10 小時的間隔設定過期。
  • ↳ 原因:
  • ➝ 即使內容不常修改, 佈景主題、小工具、外部資源(JS/CSS) 等仍可能發生變更
  • ➝ 降低伺服器負擔的同時, 也能透過定期更新快取保持最新狀態
  • ➝ 快取保留太久時, 可能錯過更新時機,讓過時的頁面被顯示出來

◻️清除

  • 🗑️ 發生下列事件時,會自動清除整個網站的快取。
  • ↳ 內容類型相關
  • ➝ 當文章 發佈, 編輯, 移至回收桶時 (不只清除該文章的快取,而是 清除整個網站的快取)
  • ↳ 留言相關
  • ➝ 當留言 發表, 編輯, 標示為垃圾留言, 刪除(移至回收桶)時
  • ↳ 分類法詞彙相關
  • ➝ 當分類或標籤等 分類法詞彙被新增、編輯、刪除時
  • ↳ 使用者相關
  • ➝ 使用者被新增、編輯、刪除時
  • ↳ 外掛相關
  • ➝ 當外掛 啟用或停用時

◻️版本

  • 🗂️ 依環境建立不同的快取版本。
  • ↳ 建立 WebP 版本
  • ➝ 另外建立支援 WebP 圖片的快取
  • ※ 使用 Optimus 外掛時,可自動轉換為 WebP
  • ↳ 建立行動版快取
  • ➝ 行動裝置專用的頁面快取會另外建立
  • (PC 與行動裝置的 HTML 結構不同時很有用)
  • ↳ 建立 Gzip 壓縮快取
  • ➝ 為了加快伺服器回應速度,預先以 Gzip 壓縮的快取 建立

◻️壓縮

  • 🧾 壓縮 HTML 內的行內程式碼(CSS、JavaScript),縮小檔案大小。
  • ↳ 壓縮 HTML、行內 CSS 與 JS,移除不必要的空白與換行
  • ➝ 有助於加快頁面載入速度
  • ➝ 外部 CSS/JS 檔案不在處理範圍內(此外掛只處理 HTML 內的程式碼)

壓縮 CSS 與 JavaScript 檔案時,依所使用的外掛不同,部分表格或輪播功能可能無法正常運作,或無法顯示在畫面上。

這是因為腳本的相依結構或 DOM 載入順序被打亂,在 Genesis Blocks、Spectra、Elementor、Beaver Builder、WPBakery 這類區塊型或頁面建構器外掛中,可能出現版面錯亂或互動功能錯誤。

無論使用哪一款快取外掛,依所用的區塊或頁面建構器不同,本來就可能發生無法正常運作的錯誤,因此使用快取外掛時,壓縮行內程式碼後一定要測試。

🔲 快取排除

  • 🚫 符合特定條件時,可以設定為略過、不套用快取。
  • ↳ 文章 ID
  • ➝ 輸入要從快取中排除的 特定文章 ID,以逗號(,)分隔(例如:2,43,65)
  • ↳ 頁面路徑
  • ➝ 可依 URL 路徑略過快取,並可搭配 正規表示式(RegEx) 使用
  • 例如:/^(\/|\/forums\/)$/
  • ↳ 查詢字串(Query String)
  • ➝ 含有特定 URL 參數時略過快取
  • ↳ Cookie
  • → 在留言者、WooCommerce 購物車等情況下排除快取

✅ 速度測試

在 Cloudways 測試伺服器的 WordPress 上安裝 Cache Enabler 1.8.17,並以首頁的首位元組時間(TTFB)測量速度。在沒有快取外掛、Cache Enabler 預設值、本文設定畫面值這三種狀態下,各送出兩輪、每輪 10 次未登入的請求,比較中位數。

📊Cache Enabler 套用前後的首位元組時間中位數 · 20 次
沒有快取外掛啟用 Cache Enabler
首頁首位元組時間(TTFB)
每種狀態各送出兩輪、每輪 10 次未登入請求,共 20 次的中位數。請求中加入了與瀏覽器相同的 Accept 標頭。
060120180240ms
無快取220.9ms沒有快取外掛
預設值55.1ms快取回應 20/20
設定畫面值49.8ms快取回應 20/20
數字是 2026 年 10 月 18 日在 Cloudways 測試伺服器上測得的值。

沒有快取外掛時為 220.9ms 的首位元組時間,在啟用 Cache Enabler 後縮短為 55.1ms 與 49.8ms。兩種狀態下 20 次請求全都由快取檔案回應;由於本文的設定畫面值就是所有項目都停用的預設值,第三種狀態的設定與預設值相同。

首位元組時間以 curl 的 [time_starttransfer] 值確認。清除快取後的第一個請求是用來建立快取檔案的請求,因此排除在外;請求中加入與瀏覽器相同的 Accept 標頭,以 1 秒間隔送出 10 次。

for i in $(seq 1 10); do curl -o /dev/null -s -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' -w '%{time_starttransfer} dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} code=%{http_code} size=%{size_download}\n' https://example.com/; sleep 1; done
0.044486 dns=0.000822 connect=0.003370 tls=0.020494 code=200 size=69959
0.071422 dns=0.000931 connect=0.003773 tls=0.031606 code=200 size=69959
0.070819 dns=0.001895 connect=0.004429 tls=0.031945 code=200 size=69959
0.071406 dns=0.000864 connect=0.003669 tls=0.032210 code=200 size=69959
0.069090 dns=0.000730 connect=0.003313 tls=0.033588 code=200 size=69959
0.054738 dns=0.001762 connect=0.004164 tls=0.023497 code=200 size=69959
0.060193 dns=0.000968 connect=0.003666 tls=0.031874 code=200 size=69959
0.057628 dns=0.000701 connect=0.003082 tls=0.030156 code=200 size=69959
0.061533 dns=0.000578 connect=0.003010 tls=0.025478 code=200 size=69959
0.079976 dns=0.000556 connect=0.003346 tls=0.029491 code=200 size=69959

上面的輸出是 Cache Enabler 預設值狀態下的第 2 輪測量;每次請求都會重新連線,因此 [tls] 欄位中到 TLS 連線完成為止的時間,也包含在首位元組時間內。

用 curl 測得的首位元組時間沒有縮短,並不代表 Cache Enabler 沒有運作。因為對於 Accept 標頭中沒有 [text/html] 的請求,Cache Enabler 不會建立或提供快取檔案。

for i in $(seq 1 10); do curl -o /dev/null -s -w '%{time_starttransfer} dns=%{time_namelookup} connect=%{time_connect} tls=%{time_appconnect} code=%{http_code} size=%{size_download}\n' https://example.com/; sleep 1; done
0.251081 dns=0.005972 connect=0.009569 tls=0.042509 code=200 size=69876
0.205716 dns=0.000560 connect=0.003334 tls=0.022671 code=200 size=69876
0.229798 dns=0.000759 connect=0.003258 tls=0.031652 code=200 size=69876
0.230230 dns=0.001500 connect=0.004246 tls=0.032241 code=200 size=69876
0.189573 dns=0.000645 connect=0.003234 tls=0.030598 code=200 size=69876
0.227845 dns=0.000759 connect=0.003265 tls=0.030934 code=200 size=69876
0.208334 dns=0.001538 connect=0.003971 tls=0.021570 code=200 size=69876
0.229638 dns=0.000571 connect=0.002924 tls=0.020581 code=200 size=69876
0.214610 dns=0.000575 connect=0.003165 tls=0.020606 code=200 size=69876
0.217078 dns=0.000610 connect=0.003252 tls=0.022737 code=200 size=69876

去掉 Accept 標頭時,curl 會送出預設的 [Accept: */*],即使在同樣的預設值狀態下,首位元組時間也是 0.19~0.25 秒。回應大小也是少了一行 Cache Enabler 註解的 69,876 位元組。

curl -s -o /dev/null -D - -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7' https://example.com/
HTTP/2 200
server: nginx
date: Sat, 17 Oct 2026 23:32:11 GMT
content-type: text/html; charset=UTF-8
vary: Accept-Encoding
vary: Accept-Encoding
x-cache-handler: cache-enabler-engine

瀏覽器開啟頁面時,會在 Accept 標頭中帶上 [text/html],因此未登入的訪客會收到快取檔案。以快取檔案回應的請求,會加上 [x-cache-handler: cache-enabler-engine] 標頭。

Cache Enabler 只處理 GET 請求,所以像 [curl -I] 這樣以 HEAD 送出請求時,即使有快取檔案,也不會顯示這個標頭。

✅ 綜合評價

比較項目沒有快取外掛Cache Enabler 預設值備註
首位元組時間中位數220.9ms55.1ms縮短約 75%
150ms 以下比例0%(0/20 次)100%(20/20 次)套用後最高 123.1ms
快取檔案回應0/20 次20/20 次回應標頭 [x-cache-handler]
curl 預設請求中位數203.3ms222.5ms[Accept: */*] · 快取檔案回應 0/20 次

Cache Enabler 只要啟用,即使設定畫面的 16 個項目都維持預設值,也會以快取檔案回應未登入訪客的頁面請求。首位元組時間落在 50ms 上下,約為沒有快取外掛時的四分之一。

Cache Enabler 設定畫面中沒有壓縮外部 CSS 與 JavaScript 檔案的項目,因此下一步是設定優化外掛。

🔢 FAQ & 推薦內容

工具列上的 [Clear Site Cache] 會清除整個網站的快取;在網站前台開啟頁面時出現的 [Clear Page Cache],則只清除該頁面的快取。在伺服器上,可使用 WP-CLI 指令 [wp cache-enabler clear]。在 Cloudways 測試伺服器上執行時,會輸出 [Success: Site cache cleared.],快取資料夾也被刪除。

停用後,[wp-content/advanced-cache.php]、設定檔與快取檔案都會被刪除,[WP_CACHE] 定義也會從 [wp-config.php] 中移除。在 Cloudways 測試伺服器上結果也相同,而儲存設定值的資料庫選項 [cache_enabler] 則保留了下來。根據官方文件,這個選項會在刪除外掛時一併刪除。

對於帶有登入 Cookie(wordpress_logged_in)的請求,Cache Enabler 不會提供快取檔案。留言者(comment_author)與受密碼保護文章(wp-postpass)的 Cookie 也在同一份預設排除清單中。官方文件也建議在登出狀態下,透過頁面原始碼結尾的 Cache Enabler 註解確認快取是否運作。

🧭 快取外掛相關文章 文章 15
🗂️ 快取外掛
📝 快取 · 優化外掛 📝 W3 Total Cache 📝 WP Super Cache 📄 Cache Enabler 📝 WP Fastest Cache 📄 WP Rocket 設定教學 📝 WP OPcache 外掛
📄 WP Rocket 速度測試 📝 W3 Total Cache 速度測試
📄 Perfmatters 教學 📝 Autoptimize 📝 Clearfy Cache 📄 IMAGIFY 設定
📋 快取:定義與所有領域 📄 網站快取 & 伺服器內部快取
沒有搜尋結果。

ℹ️ 聯盟行銷說明
本站內容包含聯盟行銷連結。訪客透過這些連結購買商品或服務時,本站會從賣家獲得佣金。在這個過程中,購買者支付的金額(遇到活動折扣時金額會降低↓)並不會因此提高。刊登的價格、折扣與庫存資訊以撰寫當時為準,可能與實際情況不同,購買前請向賣家做最後確認。商品的挑選與評價依本站自訂的標準撰寫,是否支付佣金不會影響介紹順序或評價內容。

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

Prove your humanity: 9   +   3   =