Blog Sections Open
Caching Nested Snippet Output More Aggressively in Evolution CMS
A short performance note showing when nested snippet calls can stay cached and how that reduces unnecessary parser work on static sections.
Legacy MODX Evolution documentation often taught one safe rule: if a snippet contains another snippet call, make the outer call uncached. That is correct for dynamic filters and request-driven widgets, but it is not always the most efficient choice for static output.
The point of the note
If the outer snippet output is effectively static, you can often keep the whole chain cached instead of forcing the parser to rebuild it every time.
[[Ditto? &tpl=`tpl-tpl`]]
// inside tpl-tpl
[[snippet]]
When this is safe
- the content does not depend on current request parameters
- there is no per-user personalization
- the nested snippet output is also effectively static
When not to do it
- filters, sorting, pagination, or search depend on the request
- the listing must react to session or user state
- the manager needs changes to appear immediately without cache refresh
This is a small optimization, but on older sites it often made section pages cheaper to render simply by letting more of the parser result fall into cache.
Extending getResources tvFilters with Additional Comparison Operators
A practical parser-level tweak for older getResources setups that need richer TV comparisons such as <>, <=, and >= inside tvFilters.
Do You Really Need PHx in an Evolution CMS Project?
A reflective legacy note on when PHx was useful, when it added overhead, and why many of its everyday jobs could be replaced by simpler snippets.