Make the tag cloud macro async

Hi everyone,

I would like to propose that we make the tag cloud macro async, with user and wiki as context elements. The macro is a wiki macro, so making it async is easy. The wanted effect is that the tag cloud would no longer block the loading of the dashboard and navigation panel, also in the administration, and thus make the bad performance of the tag cloud on large wikis with many tagged pages less severe. I wouldn’t enable caching as we have no built-in criteria to expire the cache.

While we should continue working on making the tag cloud faster, this won’t be easy, and I think making the tag cloud async would be a good and safe interim solution (that could also be kept when have a faster but possibly still slightly slow tag cloud implementation). My vision for making the tag cloud itself faster would be to move the tag cloud to being based on data from Solr after fixing some issues there, but it is unfortunately hard to say when that would be possible.

Any thoughts, any possible issues I’ve missed? There will be a visible flickering/layout shift when the tag cloud loads, but I think that’s minor compared to the whole page being slow to load.

For reference, this proposal is for XWIKI-25063.

+1

+1

Thanks,
Marius

+1 thanks

Actually I have one UX question. What do you plan to display while the tag cloud is loading asynchronously?

I didn’t plan to implement any explicit UI feature, the implementation is supposed to just set the async flag of the wiki macro to true and the async context to user and wiki. So this uses whatever the async rendering framework does. From what I/Claude Code found:

  • initially, the placeholder is empty
  • the polling requests waits for 500ms on the result. If a result is returned, the empty placeholder is directly replaced by the content. Otherwise, after the 500ms, a Font Awesome spinner icon is displayed that rotates with fa-spin (hard-coded Font Awesome, doesn’t use the icon theme).

So if the tag cloud doesn’t load within 500ms after the initial page load, a rotating spinner icon is displayed until it loads.

+1, thanks.

+1 thx

Thanks. I fear it can be perceived as a bug without more explanations, but a spinner is better than nothing.