Since 10.10 XWiki provide various tools to make easier to execute part of the UI asynchronously.

Support for asynchronous execution is integrated in:

There is also two public entry points to manipulate contextual information related to the asynchronous rendering:

AsyncContext component

  • is/setEnabled: indicate if asynchronous rendering is allowed in the current context (for example it's disabled when doing HTML export)
  • use* methods: indicate what kind of elements is used in the current context so that it's registered with the cached rendering to know when to invalidate it (for example XWiki#getDocument register the loaded document so that the cached content which needed to load that document is automatically invalidate when the document is modified in any way)

async script service

The "async" script service expose the AsyncContext API and also add the following:

  • flushCache: remove from the cache all the result of asynchronous rendering
Created by Thomas Mortagne on 2018/12/17 15:27

Get Connected