Computer Magic Logo
Macro caching

Saturday, August 8, 2015

Published by Aristotelis Pitaridis

Macros has the ability to cache the output of the Macros. This is very useful when we have Macros that does not change too often or we have a high traffic site and we want to improve the performance.

The first thing that we have to do is to select the MyFirstMacro node from the node Macros of the Developer section.

The Macro properties will appear on the Screen. We scroll down and find the Cache settings.

For the caching we have the following three different properties.

  • Cache period. The time that the cache will remain until it will be refreshed.
  • Cache by page. If we check this checkbox then we will ask from Umbraco to implement caching which will based on page. This means that if a user visits a page and after 1 second another user visits the same page, the second user will display the cached page generated for the first user.
  • Cache personalized. IF we check this checkbox then we will ask from Umbraco to implement caching which will based on visitor. This means that if a person visits the page and then another person visits the same page within the cache period Umbraco will generate the page from the beginning. If a person visits the page and the same person visits the same page within the cache period then the user will see the cached page.

We define the settings for the caching and we click the Save button which is located at the upper right corner of the screen in order to save the changes.