We have a modular mechanism whereby multiple instances of a given macro can be added to a page.
As such, is it possible to cache the macro per page, per instance (i.e. if we just cache the macro per page and we include the macro twice on the same page then the second instance will show the same output as the first)?
The cache key used by the macro is generated using the alias name, plus the additional parameters that are passed through. Not sure how you are calling the macros, but I'll use WebForms as an example...
Macro cache per instance on a page
We have a modular mechanism whereby multiple instances of a given macro can be added to a page.
As such, is it possible to cache the macro per page, per instance (i.e. if we just cache the macro per page and we include the macro twice on the same page then the second instance will show the same output as the first)?
Hi Janusz,
The cache key used by the macro is generated using the alias name, plus the additional parameters that are passed through. Not sure how you are calling the macros, but I'll use WebForms as an example...
I can't remember the exact format for the cache key, but this would generate something like
umb_macro_MyMacro_foo_bar
(you get the idea).So if you use the advanced macro parameter syntax you could make the cache key unique (for that instance) ...
Then if your subsequent macros have pass in unique parameters, then they'll be cached accordingly.
Hope this helps?
Cheers,
- Lee
is working on a reply...