前言介紹
- 這款 WordPress 外掛「WP Fragment Cache」是 2014-04-25 上架。
- 目前有 10 個安裝啟用數。
- 上一次更新是 2014-06-18,距離現在已有 3973 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.7.0 以上版本才可以安裝。
- 尚未有人給過這款外掛評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
cache | caching | cache block | performance | output caching |
內容簡介
此外掛需要 PHP 版本 5.3.6 或更高版本,並且必須啟用 持久化快取後端 以使用 WordPress 物件快取。
新增緩存特定網站區域的能力。此外掛適用於無法使用全站頁面緩存或有大量網頁且頻繁變更的網站。
可將 WP_Query(繞過資料庫查詢) 的整個迴圈進行快取,或僅快取迴圈的 HTML 輸出,當查詢結果有變更(例如新增留言、編輯文章、編輯文章元資料等)時,快取將會失效並重新生成。
使用範例:
// 需要進行緩存的內容
參數:
$wp_query_or_blockname
(mixed/string) (選填) WP_Query(WP_Comment_Query) 回傳結果或字串。
預設值:呼叫啟動時的檔案和行數(例如 widgets/most-commented.php:18)。
$duration
(int/string) (選填) 定義快取保留時間的秒數。若設為 0,快取將不會過期。若設為 "only_today" 字串,快取將於當天結束時過期。您可以使用 WordPress 時間常數。
預設值:86400 (一天)。
進階使用:
請參考 GitHub 上的 wiki 頁面。
原文外掛簡介
This plugin requires PHP version 5.3.6 or greater and can’t be activated without a persistent backend for the WordPress Object Cache.
Adds ability to cache particular sections of your site. This plugin is for people who can’t use a full page cache or for sites with lots of pages and with frequent changes.
It can cache entire loops with the WP_Query(bypassing the database queries) or only the html output of the loop and if the query results has changed(comment added, post was edited, postmeta has changed …) the cache will be invalidated and regenerated.
Example usage:
//content to be cached
Parameters:
$wp_query_or_blockname
(mixed/string) (optional) a WP_Query(WP_Comment_Query) result or a string.
Default: the file and the line where the call was initiated(e.g. widgets/most-commented.php:18).
$duration
(int/string) (optional) Defines how many seconds to keep the cache for. If you pass 0 the cache will not expire. If you pass the string “only_today” the cache will expire at the end of the current day. You can use WordPress Time Constants.
Default: 86400 (one day).
Advanced usage:
See the wiki pages on GitHub
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「WP Fragment Cache」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
WP Cache Block 》新增全局快取某些程式碼的功能。, WP Cache 和其他一些快取外掛程式運作得非常出色,但是對於有大量登入使用者的網站來說,它們的好處受到限制。在這些項目中...。