OnDocFormSave, it understands exactly which page you are editing and updates only that specific cache file, leaving the rest of your site running at maximum speed.
monsterfpc.cachelife): Defines how long (in seconds) a cached page remains valid. If set to 0, the cache will never expire automatically and will only be refreshed when the resource is manually updated.
monsterfpc.enabled): The master switch. Set to 1 to activate the cache engine or 0 to disable it entirely across the site.
monsterfpc.exclude): A powerful filter to prevent specific pages from being cached. Enter URL patterns or extensions, such as .xml or /checkout.
monsterfpc.minifyhtml): When enabled, the engine automatically strips unnecessary whitespace, tabs, and hidden comments from the DOM before saving to disk, keeping files extremely lightweight.
monsterfpc.sitemaps): A comma-separated list of your XML sitemaps (e.g., /sitemap.xml). Used by the Dashboard Widget to silently crawl and warm up your cache in the background.
If you need dynamic content (like a shopping cart, CSRF tokens, or a user greeting) on a fully cached page, you can punch a hole through the static cache using the included Ajax snippet.
Your snippet:
[[!YourDynamicSnippet? &property1=`value`]]
Must look like this:
[[!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.
MonsterFPC 2.0 operates mainly on the OnHandleRequest and OnWebPagePrerender events. When an anonymous user requests a URL, the plugin reads a JSON map associated with the current MODX Context to locate the exact resource ID file (e.g., web/15.html).
Because it intercepts the request at OnHandleRequest, it completely skips the MODX database and routing overhead, serving the physical file instantly.
?fbclid=, ?gclid=, or UTM parameters). This prevents ad-trackers from tricking the cache engine into creating thousands of duplicate HTML files for the exact same page.
Version 2.0 includes a dedicated Dashboard Widget to warm up your cache silently.
Simply add the "MonsterFPC Crawler" to your MODX Dashboard. With a single click, it reads your configured XML sitemaps and extracts all the URLs to build a processing queue.
Instead of hitting your server with hundreds of concurrent requests (which would spike your CPU, crash PHP, or trigger your hosting's rate limits), the crawler uses a controlled background iframe mechanism.
?mfpc_warm=1) to the requests, ensuring the cache engine knows it's an authorized internal process and can process the page cleanly.
Verifies the existence of MODX and reads the global monsterfpc.enabled setting.
$isExcluded)An isolated anonymous function that processes the monsterfpc.exclude setting. It supports both line breaks and commas to prevent code duplication.
OnHandleRequest Event (Read)mgr context.q and mfpc_warm).mgr at the server level and the current context).$isExcluded() check.explode instead of strtok to avoid breaking global MODX routing).filesize > 0), injects the proper HTML headers, and serves it instantly.OnWebPagePrerender Event (Write)cacheable flag and completely excludes pages configured as 404/403.$isExcluded() check.str_replace and preg_replace rules), encapsulated in a temporary variable ($tempOutput) to prevent blank files in case of PHP memory limits.OnDocFormSave Event (Surgical Purging)Deletes only the specific physical .html file and the JSON record corresponding to the resource ID that was just saved.
OnSiteRefresh Event (Global Flush)Deletes the entire physical cache directory and map files when the native MODX cache is manually cleared.
MonsterFPC is free to use for personal and commercial projects.
You may install it on unlimited domains, including local and staging environments.
Redistribution, resale, or rebranding of this package is not permitted.
Please keep attribution to the original author.
The software is provided “as is”, without any warranties or guarantees of fitness for a particular purpose.
Use at your own risk.
If you find MonsterSearch useful, consider supporting its continued development.
I have many ideas for new MODX tools and apps — your support helps me keep creating and improving tools for everyone.
If you would like to support the continued development of this project, consider making a donation.
Support developmentQuestions regarding file permissions or exclusions? Feel free to contact me at any time.
Contact Me