MODX Snippet Caching: Resource Update Invalidation Behavior
0 reputation · 02 Mar 2025, 13:36 UTC
MODX Revolution employs a snippet caching mechanism that stores execution results in the database to minimize CPU overhead. This system relies on a Time To Live (TTL) setting to determine when a snippet must re-run its internal logic.
A design uncertainty exists regarding the relationship between resource updates and the cache table. While the TTL governs automatic expiration, it is unclear how the system handles manual resource saves in relation to dependent cached snippets.
Constraints
- Snippets may depend on data from multiple resources.
- The cache is stored as HTML fragments in the database.
- Placeholders allow for partial dynamic injection within cached blocks.
Does updating a MODX resource trigger an immediate purge of all cached snippets associated with that resource, or do those snippets continue to serve stale content until the TTL expires?