內容簡介
總結文案:
Simple Page Cache 是一個極其簡單、超快速的 WordPress 頁面快取外掛。此外掛將完整的 HTML 頁面存儲在磁碟上,以提供給非登入訪客瀏覽。快取不會自動過期,僅能手動清除。適合小型到中型網站和網店,希望在不需要複雜設定的情況下實現最大速度。
問題與答案:
問題:Simple Page Cache 的主要特點有哪些?
答案:
- 针对未登入用户的快取(僅限GET請求)
- 快取文件存储在 /wp-content/cache/simple-page-cache/
- Drop-in (advanced-cache.php) 可在 WordPress 載入前實現最大速度
- 自動檢測動態頁面(購物車、結帳、帳戶、願望清單)的支持:
- WooCommerce
- BigCommerce for WordPress
- Easy Digital Downloads
- iThemes Exchange
- Jigoshop
- WP-Shop
- 检测到的動態頁面將自動被排除在快取之外
- 通过管理工具條按鈕進行手動清除快取
- 沒有複雜的設定,也不會寫入數據庫
問題:Simple Page Cache 如何運作?
答案:
- 對於每個未登錄訪客和每個 GET 請求,將創建並提供一個靜態 HTML 文件。
- 自動檢測具有動態電子商務頁面特徵(例如購物車、結帳、帳戶、願望清單),並將其排除在快取之外。此外掛識別 WooCommerce、BigCommerce、Easy Digital Downloads、iThemes Exchange、Jigoshop 和 WP-Shop。
- 自動維護一個排除頁面的列表,存儲在快取目錄中。
問題:如何清除快取?
答案:
- 按管理工具條中的「清除頁面快取」按鈕(僅限管理員可見)以刪除所有快取文件。
問題:當停用插件時會發生什麼?
答案:
- 進行插件停用時:
- advanced-cache.php 下降檔將被刪除。
- 如果此插件放置,則從 wp-config.php 中刪除 define('WP_CACHE', true); 行。
外掛標籤
開發者團隊
原文外掛簡介
Simple Page Cache is an extremely simple, super-fast page cache for WordPress. The plugin stores full HTML pages on disk for non-logged-in visitors. The cache is automatically cleared when content is updated, ensuring visitors always see fresh content. Ideal for small to medium-sized sites and webshops that want maximum speed without complex settings.
Main features:
– Caching for non-logged-in users (GET requests only)
– Path-based cache structure for nginx direct serving (/host/path/index.html)
– Cache files are stored in /wp-content/uploads/simple-page-cache/
– Drop-in (advanced-cache.php) for maximum speed before WordPress loads
– Nginx configuration generation for direct cache serving
– Automatic cache clearing when posts/pages are updated
– E-commerce integration with intelligent cache clearing for:
– WooCommerce (orders, stock updates, product changes)
– Easy Digital Downloads (purchases, download updates)
– BigCommerce for WordPress (product updates)
– Generic e-commerce plugins (product post types)
– Automatic detection of dynamic pages (cart, checkout, account, wishlist) for:
– WooCommerce
– BigCommerce for WordPress
– Easy Digital Downloads
– iThemes Exchange
– Jigoshop
– WP-Shop
– Detected dynamic pages are automatically excluded from caching
– Manual cache clearing via admin bar button
– Nginx config regeneration via admin bar button
– Performance comments in cached HTML files
– No complex settings, no database writes
Nginx Configuration
For maximum performance, you can configure nginx to serve cached files directly without PHP processing:
Copy the nginx configuration from /wp-content/uploads/simple-page-cache/nginx.conf
Add the configuration to your nginx server block for your domain
Test nginx configuration: sudo nginx -t
Reload nginx: sudo systemctl reload nginx
The nginx configuration includes:
– Internal location block for serving cached files
– Automatic cache bypass for logged-in users
– Automatic cache bypass for requests with query strings
– Debug headers to identify cache hits
Benefits of nginx direct serving:
– Faster response times (no PHP processing)
– Lower server load
– Better scalability
– Direct file serving from disk
How it works
For every non-logged-in visitor and every GET request, a static HTML file is created and served.
Path-based cache structure: Cache files are organized as /host/path/index.html for direct nginx serving.
Pages with characteristics of dynamic e-commerce pages (such as cart, checkout, account, wishlist) are automatically detected and excluded from caching. The plugin recognizes WooCommerce, BigCommerce, Easy Digital Downloads, iThemes Exchange, Jigoshop, and WP-Shop.
The list of excluded pages is automatically maintained in a file in the cache directory.
Automatic cache clearing: When posts or pages are updated, the plugin efficiently clears cache using the new path-based structure and scans for related content.
E-commerce integration: For WooCommerce, when orders are placed or product stock is updated, the plugin automatically clears cache for the affected products and related pages (categories, tags, shop pages, homepage).
Performance comments: Each cached HTML file includes a comment with timestamp and host information for debugging and transparency.
Nginx integration: Generated nginx configuration allows direct serving of cached files without PHP processing for maximum performance.
Clearing the cache
Click the “Clear Page Cache” button in the admin bar (visible to administrators only) to remove all cache files.
Click the “Regenerate nginx.conf” button in the admin bar to regenerate the nginx configuration file.
Deactivation
When deactivating the plugin:
The drop-in advanced-cache.php is removed.
The define('WP_CACHE', true); line (if placed by this plugin) is removed from wp-config.php.
