[WordPress] 外掛分享: WP LCache

前言介紹

  • 這款 WordPress 外掛「WP LCache」是 2016-09-07 上架。
  • 目前有 10 個安裝啟用數。
  • 上一次更新是 2019-04-30,距離現在已有 2201 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
  • 外掛最低要求 WordPress 4.3 以上版本才可以安裝。
  • 有 6 人給過評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

stevector | getpantheon | danielbachhuber |

外掛標籤

apc | apcu | cache | lcache | caching |

內容簡介

對於關注高流量、已登入使用者速度或動態頁面加載的網站來說,高速和持久的物件快取是必須的。 WP LCache 通過使用 APCu、PHP 的內存快取來改進 Memcached 和 Redis 物件快取實現方式,使其與多個 Web 節點兼容。 WP LCache 在幕後使用 LCache,這是一個將多核心處理器的分層快取模型(帶有本地 L1 和中央 L2 快取)應用於 Web 應用程序的庫。

注意:WP LCache 的開發目前已暫停,不建議在生產環境中使用,因為存在 APCu 快取碎片化問題。另外,也由 Pantheon 維護的 WP Redis 是一個很好的替代方案。

WP LCache 的速度比其他物件快取實現方式更快,因為:

- 通過使用內存中的 APCu, WP LCache 使用最快的可持續物件快取後端,並避免了每個請求上的昂貴網絡連接。當使用基於 Memcached 或 Redis 的持久性物件快取時,其中 Memcached 或 Redis 位於不同的機器上,每個快取命中的毫秒成本可能會累加到每個請求的數秒網絡交易成本。
- 通過合併通用 L2 快取, WP LCache 在多個 Web 節點之間同步快取數據。然後將一個節點上的快取更新或刪除應用到所有其他節點上。如果沒有這種同步行為,因為快取池是本地機器的,所以不能在具有多個 Web 節點的服務器配置中使用 APCu。

還不確定? WP LCache 包括其他人都沒有的功能:

- 快取組被本地處理,這意味著您可以使用 wp_cache_delete_group() 刪除整個密鑰組。
- WordPress 的 alloptions 快取被分為不同的密鑰,減輕了高流量網站上的快取污染。

閱讀安裝說明,然後從 WordPress.org 或 Github 安裝 WP LCache。 創造精彩!一旦您創建了很棒的東西,請發送功能請求(或 bug 報告)給我們。

貢獻:
參與 GitHub 專案是貢獻該插件開發的最佳方式。

兩組測試運行在兩個不同的服務器上:
- Travis CI 在各種環境配置(例如 APCu 可用與否)中運行 PHPUnit 測試套件。
- Circle CI 在 Pantheon 網站上運行 Behat 測試套件,以確保該插件與 Pantheon 平台的兼容性。

這兩個測試套件都可以在本地運行。 PHPUnit 需要 WordPress PHPUnit 測試套件,並使用名為 wordpress_test 的數據庫的訪問權限。如果您尚未在本地配置測試套件,可以運行 bash bin/install-wp-tests.sh wordpress_test root'' localhost。您還需要安裝和配置 APCu,以便運行測試套件。

原文外掛簡介

For sites concerned with high traffic, speed for logged-in users, or dynamic pageloads, a high-speed and persistent object cache is a must. WP LCache improves upon Memcached and Redis object cache implementations by using APCu, PHP’s in-memory cache, in a way that’s compatible with multiple web nodes. Under the hood, WP LCache uses LCache, a library that applies the tiered caching model of multi-core processors (with local L1 and central L2 caches) to web applications.
Note: WP LCache development is currently on hold, and not recommendated for production use, due to an issue with APCu cache fragmentation. WP Redis, also maintained by Pantheon, is a great alternative.
WP LCache is faster than other object cache implementations because:

By using APCu, which is in-memory, WP LCache uses the fastest possible persistent object cache backend and avoids costly network connections on every request. When using a Memcached or Redis-based persistent object cache where Memcached or Redis is on a different machine, the millisecond cost of each cache hit can add up to seconds of network transactions on every request.
By incorporating a common L2 cache, WP LCache synchronizes cache data between multiple web nodes. Cache updates or deletes on one node are then applied to all other nodes. Without this synchronization behavior, APCu can’t be used in server configurations with multiple web nodes because the cache pool is local to the machine.

Still not convinced? WP LCache includes features that no one else has:

Cache groups are handled natively, meaning you can delete an entire group of keys with wp_cache_delete_group().
WordPress’ alloptions cache is sharded into distinct keys, mitigating cache pollution on high traffic sites. Read #31245 for all of the gory details.

Read the installation instructions, then install WP LCache from WordPress.org or Github.
Go forth and make awesome! And, once you’ve built something great, send us feature requests (or bug reports).
Contributing
The best way to contribute to the development of this plugin is by participating on the GitHub project:
https://github.com/lcache/wp-lcache
Pull requests and issues are welcome!
You may notice there are two sets of tests running, on two different services:

Travis CI runs the PHPUnit test suite in a variety of environment configurations (e.g. APCu available vs. APCu unavailable).
Circle CI runs the Behat test suite against a Pantheon site, to ensure the plugin’s compatibility with the Pantheon platform.

Both of these test suites can be run locally, with a varying amount of setup.
PHPUnit requires the WordPress PHPUnit test suite, and access to a database with name wordpress_test. If you haven’t already configured the test suite locally, you can run bash bin/install-wp-tests.sh wordpress_test root '' localhost. You’ll also need to install and configure APCu in order to run the test suite against APCu.
Behat requires a Pantheon site. Once you’ve created the site, you’ll need install Terminus, and set the TERMINUS_TOKEN, TERMINUS_SITE, and TERMINUS_ENV environment variables. Then, you can run ./bin/behat-prepare.sh to prepare the site for the test suite.

各版本下載點

  • 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
  • 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP LCache」來進行安裝。

(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。


0.1.0 | 0.2.0 | 0.2.1 | 0.2.2 | 0.3.0 | 0.3.1 | 0.4.0 | 0.5.0 | 0.5.1 | 0.5.2 | 0.6.0 | 0.6.1 | trunk |

延伸相關外掛(你可能也想知道)

文章
Filter
Apply Filters
Mastodon