Search code examples
cachingmacrosumbracoumbraco7

Umbraco macro caching - does the cache clear with new content?


I am currently investigating macro caching on my Umbraco site.

The navigation menu for my website is a macro, which extracts the nodes which are set to be included in the nav.

I have set the macro cache period to 86400 seconds (1 day). However, when a new node is created, it is seen in the macro immediately.

Is this expected behavior?


Solution

  • Yes, Umbraco clears the macro caches whenever you add, edit or delete content in the CMS. This is to avoid out of date content being displayed in the macros.

    If this isn't the behaviour you want, you can implement your own custom caching that uses your required logic. It's fairly straightforward, there's some good information about that here: http://24days.in/umbraco/2013/get-more-out-of-umbraco-using-server-side-caching-strategies/ the article is old, but most of the information in it is still valid!