--------------------------------------------------------------------------------
Monster Full Page Cache (MonsterFPC)
--------------------------------------------------------------------------------

Author: Yanni Sanmiguel
Version: 2.0.0-pl
Based on: xFPC by SCHERP Ontwikkeling
Documentation: https://modxmonster.com/

Let's be real: caching inside PHP is cool, but skipping PHP entirely is cooler.

Monster Full Page Cache is an ultra-aggressive, high-performance static caching engine for MODX Revolution. Version 2.0 completely changes the game: it bypasses the standard MODX parser by dumping your fully rendered, minified pages as pure static HTML files directly to your server's disk (mapped precisely to the HTTP_HOST and URI).

When anonymous users visit your site, your web server (Nginx/Apache) can serve these files natively. PHP and MySQL don't even wake up. The result? Zero database queries and a Time To First Byte (TTFB) in flat milliseconds.

--------------------------------------------------------------------------------
KEY FEATURES:
--------------------------------------------------------------------------------
* Native Web Server Routing: Dumps physical /index.html files so Nginx/Apache can serve them natively. 0ms TTFB.
* Client-Side Cache Warmer: Includes a background sitemap crawler and a Dashboard Widget to silently warm up the cache without crashing your server.
* Disk Exhaustion Shield (404/403 Protection): Strictly refuses to cache error pages or unauthorized routes, preventing malicious bots from filling your disk with garbage URLs.
* Surgical Cache Purging: Hooked to OnDocFormSave. Edit a resource, and MonsterFPC will only nuke that specific page's cache file, leaving the rest of the site blazing fast.
* HTML Minification: Automatically strips unnecessary whitespace, tabs, and hidden comments from the DOM before saving to disk.
* Smart URL Normalization: Ignores query strings (like ?fbclid= or ?utm_source=) to prevent massive cache duplication.
* PHP 8.2+ Native: Clean, strictly typed, and heavily validated to prevent fatal errors.

--------------------------------------------------------------------------------
USAGE & CACHE WARMING:
--------------------------------------------------------------------------------
Once installed, MonsterFPC runs automatically. It is completely "Plug & Play" and works out-of-the-box on any hosting environment (from basic cPanel to advanced VPS) without requiring you to touch complex server-level configurations or rewrite rules.

DON'T FORGET TO INCLUDE THE WIDGET FOR THE CACHE WARMER:
1. Go to System -> Dashboards -> Widgets.
2. Edit your Default Dashboard and place the "MonsterFPC Crawler" widget.
3. Set your sitemap paths in the System Settings (under the monsterfpc.sitemaps namespace).
4. Click the button in your dashboard to let the crawler iframe silently hit your pages and generate the static cache.

--------------------------------------------------------------------------------
HOLE PUNCHING (Dynamic Content in Cached Pages):
--------------------------------------------------------------------------------
If you need dynamic content (like a shopping cart, CSRF tokens, or a user greeting) on a fully cached page, use the included Ajax snippet:

[[!MonsterFPC_Ajax? &snippet=`YourDynamicSnippet` &property1=`value`]]

This renders a placeholder and uses the modern asynchronous JavaScript Fetch API to inject the snippet's output natively, without holding up the DOM or breaking the static illusion.