Limit the usage of developed macro in one page confluence server

Hello everyone.

In order to prevent a Confluence page from slow loading, is there a way to restrict the number of macros (which are actually developed plugins) that can be inserted into the Confluence page.

For example a user can insert max 10 macros in one Confluence page.

Many thanks

Ivana

Restricting content to improve performance… shouldn’t be a solution.

  • If the problem is with your macros :slight_smile: Improve them, i.e. use caching.
  • Other people’s macros: ask the developers for improvements.
  • If your instance is generally slow, improve hosting.
1 Like

Thank you @amoerchen for the answer

What do you mean by caching? Is there any example in order to see it clear picture how can be achieved?

What I have found is this documentation: How do I cache data in a plugin?

KR

Yes, you are on the right path with this documentation.

It might look complicated at the beginning, but you basically do this:

  • Move the “heavy” business logic into cache loader and only call the “get”

Unfortunately, the example is super simple. It is still possible to get more “complex” objects out of the cache.
I.e. for the “key” you can use something like “user_123_object_456” and then return some POJO (not an AO)

There are cases, where you can’t cache everything or need to use multiple caches to get the final result.
→ but if you have a slow logic somewhere try to cache the results.

1 Like