[WordPress] 外掛分享: Static Cache Wrangler

WordPress 外掛 Static Cache Wrangler 的封面圖片。

前言介紹

  • 這款 WordPress 外掛「Static Cache Wrangler」是 2025-11-11 上架。
  • 目前尚無安裝啟用數,是個很新的外掛。如有要安裝使用,建議多測試確保功能沒問題!
  • 上一次更新是 2026-01-07,距離現在已有 49 天。
  • 外掛最低要求 WordPress 5.0 以上版本才可以安裝。
  • 外掛要求網站主機運作至少需要 PHP 版本 7.4 以上。
  • 尚未有人給過這款外掛評分。
  • 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。

外掛協作開發者

derickschaefer |

外掛標籤

cache | html export | static site | static site export | static site generator |

內容簡介

總結:Static Cache Wrangler 是一個輕量、低資源的靜態網站生成器和 HTML 匯出引擎,專為 WordPress 設計。它自動創建獨立、與 URL 無關的靜態頁面,非常適合需要保存、分發或加速 WordPress 內容的使用者。

問題與答案:
1. Static Cache Wrangler 最初是為哪個工具開發的?原為什麼目的?
- 靜態網站生成器和 HTML 匯出引擎最初是作為 WP-CLI 的命令行工具開發的,旨在提供支持管理員、開發人員和網站擁有者的組合型、無影響的工具。
2. Static Cache Wrangler 使用什麼機制來生成靜態頁面?這樣的方式帶來什麼好處?
- 該外掛使用異步、延遲加載的構建機制,當訪客瀏覽您的站點時自動生成靜態頁面,可隨著時間將整個站點匯出為輕量靜態 HTML。這樣的方法幫助生成快速、適合 CDN 的 HTML 輸出,無需複雜的設定。
3. Static Cache Wrangler 與傳統靜態網站外掛有什麼不同之處?
- Static Cache Wrangler 零影響,不添加自定義數據庫表或修改模式,在外掛卸載時自動清理所有選項、定時任務和過期數據,保持 WordPress 數據庫完全原樣,並異步運行所有緩存流程。CGFloatn optional performance profiler for granular resource and execution insights.

原文外掛簡介

Static Cache Wrangler is a lightweight, low‑resource static site generator and HTML export engine for WordPress. It automatically creates self‑contained, URL‑agnostic static pages of your site — perfect for anyone who needs to preserve, distribute, or accelerate WordPress content.
Originally developed as a command‑line tool for WP‑CLI, it has evolved into composable, zero‑impact tooling that supports administrators, developers, and site owners alike. Whether you’re archiving a client project, deploying to a CDN, or creating a portable offline version that runs anywhere, Static Cache Wrangler delivers fast, CDN‑ready HTML output without complex setup.
Technically, the plugin uses an asynchronous, lazy‑loading build mechanism that generates static pages as visitors browse your site. Over time, your entire site is exported as lightweight static HTML.
Free companion plugin STCW Coverage Assistant adds real‑time build monitoring and manually triggered full‑site generation for any uncached pages.
Unlike traditional static‑site plugins that require full crawls or database schema changes, Static Cache Wrangler is zero‑impact:
* Does not add custom database tables or modify your schema
* Automatically cleans up all plugin options, cron jobs, and transients upon uninstall
* Keeps your WordPress database completely untouched
* Runs all caching processes asynchronously in the background
* Offers an optional performance profiler for granular resource and execution insights
Perfect for:
* Creating fully offline or portable copies of WordPress sites
* Rsyncing to read‑only Nginx failover servers for high availability
* Publishing WordPress content to Amazon S3®, Netlify®, or other static CDNs
* Geo‑distributing static HTML for ultra‑fast global reads
* Archiving, demos, and secure client deliverables
* Small to mid‑sized sites (≈ 100 pages +) — upcoming assistant plugin expands this to 1 K pages
* Multisite administrators needing scalable static‑cache exports
A demo site created using this plugin can be found at Cache Wrangler Demo Site which is a static version of this WordPress site
Static Cache Wrangler turns WordPress into a fast, secure, and portable static‑site generator — with no database changes, no vendor lock‑in, and no maintenance overhead.
Detailed Testing and Profiling:
* Triggering of page rendering requires 1-2MB of PHP memory for the duration of the process.
* Average processing duration is less than 500 ms (meaning memory consumption is quickly released)
* Average asset (JS, CSS, image) batch processing is less than 100 ms
* WordPress Core and theme rendering is generally 20-25 MB; SCW usage keeps total memory below 30 MB
* CLI commands are even more efficient
Funding Model
* This plugin and all companion plugins will remain 100% free (true WordPress style)
* Want to make a donation? Consider purchasing a copy of the author’s book on command-line interfaces for yourself or as a gift.
Modern CLI Book
How It Works

Enable static site generation using the toggle in the sidebar.
As users browse your site normally, each page visit creates a static HTML file.
Assets (CSS, JS, images, fonts) are automatically are queued and asyncronously downloaded and localized.
Processing happens in the background and can be paused anytime.
Use free companion plugin to monitor and accelerate cache creation STCW Coverage Assistant
Download the complete static site as a ZIP file.
Extract and open index.html in any browser — it works completely offline.

Key Features
What’s New in 2.1.2:
2.1.4
Version 2.1.4 adds STCW_META comment injection with WordPress post data (ID, post_type, permalink, dates, template) to support upcoming Headless Assistant companion plugin.
What’s Fixed in 2.1.3:
2.1.3
Version 2.1.3 fixes errantly cached files and directories related to index.php and admin in URLs.
What’s New in 2.1.2:
2.1.2
Version 2.1.2 introduces configuration details in addition to file locations on a key admin card.
What’s New in 2.1.1:
2.1.1
Version 2.1.1 introduces cache file timestamps, staleness checks, and adds sitemap creation to both the GUI and CLI zip file creation.
What’s New in 2.1.0:
2.1.0
Version 2.1.0 introduces static sitemap generation – a file system-based approach that creates sitemaps from your actual cached files rather than the WordPress database.
This update enables true static sitemaps that work in exported sites without WordPress, PHP, or a database connection – perfect for deployments to S3, Netlify, GitHub Pages, or any static hosting platform.
New WP-CLI Commands

wp scw sitemap – Generate sitemap.xml from cached static files
wp scw sitemap-delete – Remove sitemap files

Why File System-Based?
Traditional WordPress sitemap plugins (Yoast SEO, Rank Math) query the database dynamically. This works great for live sites, but fails for static exports because there’s no PHP or database available.
Static Cache Wrangler scans your actual cached index.html files to build the sitemap, ensuring:

Perfect accuracy – sitemap matches exported content exactly
True portability – works without WordPress/PHP/database
SEO compliance – search engines see what users see
Deploy anywhere – S3, Netlify, GitHub Pages, any static host

Sitemap Features

Generates sitemaps.org compliant XML sitemap
Creates XSL stylesheet for browser viewing
Calculates priorities automatically (homepage = 1.0, deeper pages = 0.4)
Assigns smart change frequencies (homepage = daily, pages = monthly)
Includes last modification times from file metadata
Developer filter hook: stcw_sitemap_changefreq
Multisite compatible with isolated sitemaps per site
Fast performance: ~50-100ms per 100 cached files

Typical Workflow
`

wp scw enable # Enable generation
Browse your site…
wp scw process # Process assets
wp scw sitemap # Generate sitemap (NEW!)
wp scw zip # Export with sitemap included
Deploy to S3/Netlify…
`

View in Browser
Open https://your-site.com/sitemap.xml – the XSL stylesheet transforms it into a readable HTML table with color-coded priorities and sortable columns.
Technical Implementation

New STCW_Sitemap_Generator class scans cached directory recursively
Uses WordPress Filesystem API for all file operations
Proper output escaping and sanitization throughout
No database queries – pure file system operations
Multisite compatible with isolated sitemaps per site
Performance optimized: ~50-100ms per 100 files, ~2MB memory for 1,000+ pages

GUI Coming Soon
This release is CLI-only to validate the approach and gather user feedback. A visual interface in WordPress admin is planned for version 2.2.0.
Compatibility

WordPress 6.8.3
PHP 7.4, 8.0, 8.1, 8.2, 8.3
Multisite compatible
WP-CLI required for sitemap generation

What’s New in 2.0.7:
2.0.7
Version 2.0.7 is a major compatibility enhancement release, focused on improving support for Kadence Blocks and all Gutenberg block plugins that rely on dynamic JavaScript and CSS enqueues.
This update improves the accuracy of static exports by capturing all front-end assets that WordPress prints dynamically—including those output by wp_print_scripts() and wp_print_footer_scripts()—ensuring that interactive block functionality is preserved outside of WordPress.
Compatibility Improvements

Full Kadence Blocks compatibility – Global front-end scripts and CSS are now correctly captured, enabling buttons, accordions, icons, Lottie animations, progress bars, and other JS-driven components to function in static exports.
Enhanced Gutenberg block support – STCW now reliably detects and exports front-end assets from all major block suites (Spectra, Stackable, GenerateBlocks, CoBlocks, Otter, etc.).
Improved script capture logic – Dynamically enqueued scripts are now collected before theme rendering, eliminating missing-asset issues for blocks that load JS only when present on a page.
Better preservation of front-end behavior – Assets required for tooltips, animations, scroll effects, responsive layouts, and block initialization are now exported consistently.
Resolved blank-page edge cases – Updated capture timing ensures no interference with WordPress’s script printing lifecycle, preventing rendering conflicts.

Technical Enhancements

Added an early script-queue flush to collect output from:

wp_print_head_scripts()
wp_print_scripts()
wp_print_footer_scripts()

Captured script output is appended to the main buffer before asset extraction, ensuring regex-based scanners detect dynamically enqueued JS/CSS.
Improved compatibility with theme and plugin lifecycle order by isolating script capture from template rendering.
Enhanced support for plugins that insert block assets conditionally based on block presence.
Increased reliability of static exports for mixed-content layouts and advanced interactive block patterns.

WP-CLI Commands
Full control without the dashboard:

wp scw enable – Enable static generation
wp scw disable – Disable static generation
wp scw status – View current status and statistics
wp scw process – Process all pending assets
wp scw clear – Remove all generated static files
wp scw zip – Create a ZIP archive of the site
wp scw sitemap – Generate sitemap.xml from cached files
wp scw sitemap --target-url= – Generate sitemap for deployment URL
wp scw sitemap-delete – Remove sitemap files

Advanced Configuration
Server Requirements

PHP: 7.4 or higher
WordPress: 5.0 or higher
PHP Extensions: ZipArchive (for ZIP export), curl or allow_url_fopen (for asset downloads)
Disk Space: Varies based on site size (static files = ~1.5x site size)
Permissions: Write access to wp-content/cache/

Performance Characteristics

Generation overhead: ~50–100 ms/page
Memory: ~2 MB additional per request
Asset downloads: Handled asynchronously in background

Disk Space Considerations
Typical Usage:
* Small site (10-50 pages): 50-200 MB
* Medium site (100-500 pages): 200 MB – 1 GB
* Large site (1000+ pages): 1-5 GB
Monitor disk usage via Settings → Static Cache or wp scw status.
To reduce disk usage, exclude large pages:
add_filter(‘stcw_should_generate’, function($should, $url) {
if (strpos($url, ‘/gallery/’) !== false) {
return false;
}
return $should;
}, 10, 2);
What Gets Downloaded
✅ CSS files, JavaScript files, Images (all formats), Fonts, Favicons, Responsive images (srcset)
❌ External CDN assets (preserved as-is), Third-party embeds (YouTube, Twitter), Video/audio files (intentionally excluded to save space)
Use Cases
Offline Documentation — Generate static, portable documentation sites for offline or air-gapped environments.
Client Deliverables — Deliver static versions that eliminate hosting complexity.
Failover Ready — Rsync to a read-only Nginx® server for uninterrupted uptime.
CDN / Amazon S3® Deployment — Publish static HTML to Amazon S3®, Cloudflare®, or Netlify® for instant global delivery.
Geo Load Balancing — Serve from multiple regions with Cloudflare or Amazon Route53® for high performance.
Archival Snapshots — Capture your site before major redesigns or migrations.
Trademark Recognition and Legal Disclaimer
All product names, logos, and brands referenced in this plugin and its documentation are property of their respective owners.
Static Cache Wrangler (also historically referred to as Static Cache Generator) must always be referenced using all three words — “Static Cache Wrangler.”
The prior name Static Cache Generator is considered a legacy name and is no longer in use, as it did not meet WordPress.org plugin naming standards due to its generic nature. That name was originally selected in good faith to avoid any potential confusion with existing trademarks or brand names.
Prior to renaming, U.S. and international trademark databases were reviewed by independent intellectual property counsel, and no conflicts or registered marks were identified for the phrases “Static Cache Generator,” “Cache Generator,” or “Static Cache.”
Counsel further cited legal precedent confirming that generic terms cannot be trademarked, including:
– USPTO v. Booking.com B.V., 591 U.S. ___ (2020)
– In re Hotels.com, L.P., 573 F.3d 1300 (Fed. Cir. 2009)
– Kellogg Co. v. National Biscuit Co., 305 U.S. 111 (1938)
The current and accepted plugin name Static Cache Wrangler:
– Does not imply, refer to, or associate with the standalone trademark “Wrangler” of Wrangler Apparel.
– Does not imply, refer to, or associate with the standalone trademark “Cache” (U.S. Reg. No. 6094619, registered July 7, 2020).
– Does not imply, refer to, or associate with any trademarks involving the standalone term “Static.”
– Has no connection with Automattic Inc., its employees, or any internal job titles (e.g., “Wrangler”) used within Automattic. The name Static Cache Wrangler does not suggest endorsement, employment, or automation of work performed by Automattic personnel.
This clarification is provided in accordance with U.S. trademark law, WordPress.org plugin repository policies, and general principles of fair use and naming transparency.
(U.S. Reg. No. 6094619 reference: “CACHE,” Registered July 7, 2020; Status: LIVE/REGISTRATION/Issued and Active — TSDR, generated 2025-10-23 08:17:17 EDT.)
Third-Party Trademark Notices
NGINX® is a registered trademark of F5, Inc.
Amazon S3® and Route 53™ are trademarks of Amazon Technologies, Inc.
Netlify® is a registered trademark of Netlify, Inc.
Cloudflare® and Cloudflare Pages™ are trademarks of Cloudflare, Inc.
WP-CLI® and Gutenberg® are trademarks of the WordPress Foundation.
Elementor® is a registered trademark of Elementor Ltd.
Divi® is a registered trademark of Elegant Themes, Inc.
GitHub® is a registered trademark of GitHub, Inc.
YouTube® is a registered trademark of Google LLC.
Twitter® is a registered trademark of X Corp.
ModernCLI.Dev is owned by Derick Schaefer.
This plugin has not been tested by any of the services, platforms, software projects, nor their respective owners.
These names and services are referenced solely as examples of where static cache files might be repurposed, used, uploaded, stored, or transmitted.
This plugin is an independent open-source project and is not endorsed by, affiliated with, or sponsored by any of the companies or open-source projects mentioned herein.
Support
For issues, requests, and documentation, visit:
GitHub – Static Cache Wrangler
Documentation & Guides
Interested in learning more about command-line interfaces and WP-CLI?
Check out ModernCLI.dev — a practical guide to mastering modern CLI workflows.

各版本下載點

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

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


2.0.6 | 2.0.7 | 2.1.0 | 2.1.1 | 2.1.2 | 2.1.3 | 2.1.4 | trunk |

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

暫無相關外掛推薦。

文章
Filter
Apply Filters
Mastodon