Surge

外掛說明

Surge 能為 WordPress 網站產生並提供靜態 HTML 檔案,進而加快要求速度、加速載入時間並縮短收到第一個位元組的時間 (TTFB)。

Surge 不需要進行組態,也沒有可供設定的選項,並且可以在任何組態良好的主機平台上隨裝即用。快取檔案會儲存於主機磁碟,並會在網站更新後自動失效。

在各種載入測試中,Surge 能夠以單核心、1GB 記憶體的伺服器,輕鬆處理 100 個同時連線每秒 1000 至 2500 個要求。這比現有的 WordPress 網站快 70 倍。

安裝方式

透過 WordPress 控制台安裝:前往 [外掛]→[安裝外掛]。在搜尋框中輸入「surge」並按下 Enter,然後在搜尋結果中找到 Surge 外掛,點擊 [安裝],安裝完畢後點擊 [啟用]。

手動安裝:從 WordPress 下載 Surge 外掛的安裝套件壓縮 ZIP 檔,然後前往 WordPress 管理後台的 [外掛]→[新增外掛]&rarrr;[上傳外掛] 選取 ZIP 檔案並點擊 [立即安裝]。上傳及安裝完畢後,點擊 [啟用]。

使用 FTP 手動安裝:從 WordPress 下載 Surge 外掛的安裝套件壓縮 ZIP 檔,解壓縮後使用 FTP/SFTP 用戶端程式將 surge 資料夾及資料夾內全部檔案上傳至 wp-content/plugins 中,然後前往 WordPress 網站管理後台的 [外掛] 頁面啟用外掛。

使用 WP-CLI 命令安裝:wp plugin install surge --activate

常見問題集

哪裡可以設定這個外掛?

這個外掛不需設定。

如何清除網站快取?

停用外掛之後再啟用,或使用 WP-CLI 執行 wp surge flush

如何確認網站快取生效?

請前往 WordPress 控制台的 [工具]→[網站狀態] 頁面。一般如安裝問題等快取錯誤,都會顯示在這個頁面。此外,請在 [無痕式視窗] 中查看網站的快取版本,還可以在伺服器回應中看到 X-Cache 標頭。

為什麼會產生快取失誤?

通常是以下原因造成:

  • 你目前是 WordPress 網站的已登入使用者。
  • 你在瀏覽器中設定了唯一的 Cookie。
  • 唯一的查詢參數也會造成快取失誤,但常見的行銷參數如 utm_campaign 等除外。
  • 這個外掛不會快取 GET 及 HEAD 之外的要求方法。

是否能將指定頁面排除於外掛的快取機制外?

可以。如果網站傳遞 Cache-Control: no-cache 標頭 (或 max-age=0),對應的要求便會遭到快取功能排除。請注意,大多數的 WordPress 外掛均會在需要時自行完成這項工作。

由於安全性理由,已停用 fpassthru()

可能出於錯誤的原因,你的網站所採用的主機服務提供商停用了 fpassthru() 函式,但這個函式是 Surge 的必要條件。請聯絡網站的主機服務提供商,並要求他們啟用這個函式。

如何為 Surge 做出貢獻?

如果 Surge 對你的網站有所幫助,請在 GitHub 存放庫上點擊星號,並在 WordPress.org 上留下評分。

使用者評論

2024 年 2 月 28 日 1 則留言
I wanted to extend my deepest appreciation for your invaluable contribution. Your Surge Cache plugin has revolutionized the performance of my website. Amidst the challenges of compatibility issues between FlyingPress and WP Rocket with Sucuri WAF, your plugin emerged as the beacon of hope. Previously, grappling with other caching plugins led to severe CPU spikes, pushing my site to the brink of breakdowns. While perfmatters provided some relief, I still needed a lightweight page cache plugin to navigate peak traffic periods seamlessly. Enter your Surge Cache plugin. Its seamless integration with my site has not only bolstered its speed but also its overall performance. I am now confident that my website remains steadfast and responsive even during the busiest of times. Thank you, from the depths of my heart, for crafting such an exceptional tool. Your unwavering dedication to enhancing website functionality is truly commendable. With warm regards, Greg
2023 年 9 月 22 日 1 則留言
Hello, for this plugin to work must the fpassthru function be activated or not? There is a difference?
2024 年 2 月 6 日 1 則留言
Over the years, I’ve looked at all the top caching plugins, and never found one that I liked. They were either too complex, too finicky, or tried to do too many things. Surge just works, and it works great. Update: I ran some basic performance testing of the same sample content with and without Surge activated.Surge increased my Requests per second by a factor of 21x and reduced my time per request by a factor of 25x. Beyond that, Konstantin has been amazing as far as support goes for a free plugin. Besides addressing issues and requests, he’s gone above-and-beyond at helping work through issues, to the point of looking at where we are using Surge and making additional configuration recommendations. If it were possible to give 6 stars, I would!
2023 年 1 月 24 日
This plugin works! Install, activate, and check WP_CACHE value and boom – your site is fast!One nice feature that is happening under the hood is caching of specific REST API requests. That makes, for example, dynamic parts of the site with javascript filtering blazingly fast.
2022 年 9 月 22 日 1 則留言
I almost gave up on finding a WP cache plugin that ONLY did that… cache! Everything is bloated with minify, CDN, image optimize, and a bunch of features I just don’t need because we have those taken care of otherwise.
2022 年 4 月 6 日 1 則留言
I’m using it for 1 month on different sites with different themes and plugins, and some big ones over 150-200GB. Works just perfect!
閱讀全部 28 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Surge〉的開發相關工作。

參與者

〈Surge〉外掛目前已有 6 個本地化語言版本。 感謝全部譯者為這個外掛做出的貢獻。

將〈Surge〉外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.1.0

  • Improved Multisite compatibility
  • Fixed occasional stat() warnings in cleanup routines
  • Fixed expiration by path being too broad
  • Added a filter for flush actions
  • Feature: added a simple events system for s-maxage and stale-while-revalidate support

1.0.5

  • Fix woocommerce_product_title compatibility
  • Honor DONOTCACHEPAGE constant
  • Use built-in is_ssl() WordPress function for better compatibility

1.0.4

  • Add a WP-CLI command to invalidate/flush page cache
  • Fix redirect loop with Core’s redirect_canonical for ignore_query_vars
  • Fix warnings for requests with empty headers
  • Fix warnings when cron cleanup attempts to read a file that no longer exists
  • Add a filter to disable writing to wp-config.php

1.0.3

  • Invalidate cache when posts_per_page is changed
  • Fix redirect loop with unknown query vars caused by Core’s redirect_canonical
  • Ignore X-Cache and X-Powered-By headers from cache metadata
  • Allow multiple headers with the same name

1.0.2

  • Fix PHP notice in invalidation
  • Protect against race conditions when writing flags.json
  • Add support for more post statuses in transition_post_status invalidation

1.0.1

  • Add support for custom user configuration
  • Various invalidation enhancements and fixes
  • Remove advanced-cache.php when plugin is deactivated
  • Add a note about fpassthru() in FAQ
  • Minor fix in Site Health screen tests

1.0.0

  • Anonymize requests to favicon.ico and robots.txt
  • Improve cache expiration, add cache expiration by path

0.1.0

  • Initial release