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.
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.