Monster Full Page Cache

What is MonsterFPC?

  • MonsterFPC is a high-performance Full Page Cache engine for MODX. It generates static, Gzip-compressed HTML snapshots of your pages, serving them instantly to visitors without touching the database or triggering heavy PHP processing.
  • The logic is simple but powerful: Most websites process the same code thousands of times for different visitors. MonsterFPC intercepts the final output, saves it to disk, and serves it directly. This reduces TTFB by up to 90%.
  • Unlike other extras, MonsterFPC was built to be "surgical". It doesn't just clear everything when you make a change; it understands which page you are editing and updates only that specific cache file, keeping the rest of your site running at maximum speed.

System Settings Explained

  • Enable MonsterFPC (monsterfpc.enabled): The master switch. Set to 1 to activate the cache engine or 0 to disable it entirely across the site.
  • Cache Lifetime (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.
  • Exclude Resources (monsterfpc.exclude): A powerful filter to prevent specific pages from being cached. Enter URL patterns or paths (one per line), such as /checkout or sitemap.
  • Minify HTML (monsterfpc.minifyhtml): When enabled, the engine strips unnecessary white spaces, tabs, and non-essential comments from the HTML, significantly reducing the final file size.
  • Combine CSS (monsterfpc.combinecss): Automatically identifies all CSS files in the <head>, merges them into a single optimised file, and serves it from the internal cache folder.
  • Combine JS (monsterfpc.combinejs): Similar to CSS combination, it gathers JavaScript files and bundles them into one single script tag just before the closing head tag.
  • Exclude CSS/JS (monsterfpc.excludecss / excludejs): Comma-separated lists of filenames that should be ignored by the combination engine (e.g., jquery.min.js).
  • Minify CSS/JS (monsterfpc.minifycss / minifyjs): Applies lightweight compression to the combined assets to further reduce file size.

Using the MonsterFPC Snippet

The snippet allows for manual control over the caching process on a per-page basis.

  • Bypass Property: Use &bypass=`1` to prevent the engine from saving or serving a cached version of the current request.
Examples:

1. Prevent caching on a specific page:

[[!MonsterFPC? &bypass=`1`]]

2. Conditional bypass (e.g., only if a URL parameter exists):

[[!MonsterFPC? &bypass=`[[!+requested_action:is=`update`:then=`1`:else=`0`]]`]]

Tip: Always call the snippet uncached (using the exclamation mark) at the very top of your Template or Resource content.

For Developers (The Techy Stuff)

MonsterFPC operates on the OnWebPageComplete and OnInitCulture events. When an anonymous user requests a URL, the plugin generates a unique hash based on the context and the URI, creating a .gz file in the file system.

The most interesting part is its Surgical Mapping System: when the cache is generated, we create a .map file on disk linked to the resource ID. This allows the plugin, when a resource is edited, to delete the exact file without costly URL calculations.

Session Note: The cache only functions for users who are NOT logged in. If you are in the Manager or have an active Frontend session, you will see a "Miss" so you can work in real-time.

Known Issues

* Cloudflare Compatibility (v1.0.1)

If your site is routed through Cloudflare and you have features like Auto Minify, Rocket Loader, or aggressive caching enabled, visitors might occasionally see a screen full of random, unreadable symbols.

This occurs because Cloudflare intercepts the pre-compressed GZIP binary data sent by MonsterFPC and attempts to inspect, modify, or re-compress it (often using Brotli). This strips the original HTTP headers, leaving the browser unable to decode the file correctly.

Workaround: This architectural conflict is actively being addressed for the next release (v1.0.2).
ModX MonsterFPC screenshot
Extra Details
  • Version: 1.0.1
  • Author: Yanni Sanmiguel
  • PHP: 7.4+ (8.1+ recommended)
  • MODX: 2.8.x & 3.x
  • Price: Free Extra
  • Link to ModX Extras Page
Download / Install Report Issues
Licence

MonsterFPC is free to use for personal and commercial projects.

If you would like to support the continued development of this project, consider making a donation.

Support development
Need help?

Questions regarding file permissions or exclusions? Feel free to contact me at any time.

Contact Me