Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

...

...

...

...

idProductTOC

...

Table of Contents
maxLevel1
excludeOn this page
typeflat
separatorpipe

Summary

The future macro improves page display performance by rendering the body contents in the background while allowing the rest of the page to be displayed. It should be used around sections of a page that take a long time to display because they access external data, run reports or scripts, or gather and summarize metadata. A manual mode is also available that defers the rendering of the section until specifically requested by the user. The future macro shipped in the CACHE is compatible with the original macro and will be is migrated to a native Confluence macro.

Tip

The future macro can be a handy way to avoid Confluence's default rendering timeout (normally 120 seconds) for request requests that are known to be long running any may sometimes exceed the limit. In these cases, it is best to also use with the Cache Macro to minimize the need for the extra processing.

...

Here is a quote from Chrisopher Owen, the original author:

For Atlassian’s 7th ShipIt Day I implemented a Confluence macro that would defer rendering its body until the full page was received by the client. The body of the macro would then be sent back to Confluence for rendering via AJAX while the user was presented with a loading placeholder. As the rendering of the body occurs in the future with respect to the original page rendering pipeline, I called this functionality the Future Macro. It is ideally suited for rendering content that is retrieved from external sources where high latency can hold up the delivery of other content on the page.

Parameters

ParameterDefaultMacro BrowserDescription
titleLoad or LoadingTitle

Text displayed before rendering completes. Also

will appear

appears on the manual button. Helps user understand what information is going to appear.

Prior to release 6.7, the default text would appear followed by the user provided title. After release 6.7, by default, only the user provided title will appear if it is not blank. There is an administrator option to control the behavior. See the incompatibility notice.

manualfalseManualWhen specified, the section
will
is only
be
rendered after the user presses the load button. The rendering proceeds in the background until available.
timeout120 secondsMaximum number of seconds to render sectionTimeout in seconds before the section rendering is abandoned. Once abandoned, a timeout error message
will be
is displayed.
delay0Delay in secondsRendering
will be
is delayed by the number of seconds requested. The client browser
will delay
delays sending the request to the server to render the body. This applies only to manual=false cases. This can be used in cases where there are multiple future macros on the same page and it is more important to render some of these more quickly than others so the results for those
will
appear quicker. Since 6.7.
retryIntervalDefaultRetry interval in seconds

When greater than 0 and the rendering of the body indicates an error that can be retried, the client

will wait

waits and then retry the request. See Retry Feature. Default uses the default setting configured in administration. Since 6.8.



Section


Column

 Default loading message


Column

Manual load


Column

Macro browser preview loading

Info

Note that in macro browser preview, only the loading message will showis displayed. The body will is not be rendered in the preview window.



Examples

Video

Future Macro - Example Video

SQL Example

Section


Column

Image RemovedImage Added


Column


No Format
{future}
{sql:dataSource=exampleDSTestDS}
select * from products
{sql}
{future}



...