Understanding caching of placeholders in MODx Revo

Caching has had a serious update in MODx Revolution. Now, any element can be called uncached which provides an amazing granularity to caching. However, it also has a gotcha that if you aren't aware of will have you scratching your head for a while.

Users of MODx Evolution will immediately know that snippets can be called cached or uncached. Uncached snippets being needed if any dynamic processing is required, for example, processing a contact form submission. In addition, the page could also be called uncached.

So, what about MODx Revolution? Well, we still have the same snippet caching and page caching options available. However, the caching is also extended to other elements as well. For example, to have a placeholder that's uncached, we do:

[[!+myPlaceholder]]

But, why would we need that? The answer is simply having an understanding of the new caching mechanisms in use by MODx Revolution.

If we have a snippet that:

  • sets a dynamic placeholder,
  • is called uncached,
  • with the page being cached.

Then we will also need to ensure the placeholder is called uncached. Otherwise, the placeholder will be cached along with the page and the dynamic placeholder will not rendered as intended.

Bookmark and Share

Comments (0)






Allowed tags: <b><i><br>Add a new comment: