Versions Compared

Key

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

...

Confluence allows more advanced users to construct pages that bring in data from various sources and present the data in nice ways like charts and tables. Unfortunately, some of these types of pages can be very slow to render for users. Fortunately, there are a number of advanced techniques that can be used to significantly improve page rendering performance or restructure pages to provide a better user experience. 

Excerpt

This page provides some hints and tips for improving performance to render complex pages

...

It is important to note that all the elements of a page must be rendered even if portions of the page are not displayed initially. For instance, if you use constructs that have tabs or have expand and contract sections, all the data in those sections still must be rendered. Generally, the display of the data is controlled by the browser with no further interaction with the server (an exception is delayed rendering discussed below). This means that pages with a large amount of data that is gathered and processed but not shown immediately to the user , may be wasted processing if the most likely user interaction is to not look at that tab or hidden section.

...

Tip
titleUse caching

Cache Macro allows data to be extracted once and the rendering re-used for subsequent access to the page. The cache macro parameters allow you to control the length of time the data is cached. Care must be taken to not overuse this capability as there is limited amount of memory allocated to the cache across the system. You can optionally provide the user with a refresh button to give them control over the trade-off between the currency of the data and time to display. Recommend only using the refresh option only in limited cases, as it is likely to be used and then the user has to wait again. Advanced users (authors) can force a refresh anyway by using a request parameter - add ?refresh=true to the page url (sometimes &refresh=true must be added instead if the url already has a request parameter specified).

...

Warning
titleSecurity

Be careful with using caching on pages that present data to some users but not others. Users with more authority may can produce cache data that can be viewed by a different user at a later time. This also applies to references to data or attachments from other pages - the . The authority for producing the cache is based on the user that is viewing the page when the cache has expired. There are techniques to address this as well by providing multiple views of the data, one for each group, each with there own cache. The show-to and hide-from macros can be used.

Converting data from other formats into charts and tables can be expensive. The cache macro can help here too, but there are special considerations for charts. The chart macro converts the chart data into a an image that is then sent to the browser to display.

Tip
titleSave chart images

There are advanced chart macro parameter parameters for attachments that allow chart images to be automatically rendered and saved. Similarly for Graphviz graphs.

...

The techniques above in many cases also help with download time. Pages with less data download faster. Providing page links to data spread out the interaction time over a number of requests. A balance must be made to make sure ensure the user gets the data they normally want without an excessive amount of clicking.

...

If the page has multiple portions that each can take a while to render and the techniques above do not apply, use the future macro around the later portions of the display so that the user perceives that the page is available quicker even though more data gathering is taking place in the background. This is especially useful for tabbed displays where the data on the tabs can be. Warning, data displayed in tabs. (Note: the tab to be displayed may not be the first one , since , the tab the user last used on a previous visit may be shown first.)

Automated caching

The first user to view a page after the cache period has expired can be delayed a significant amount of time while the cached data is being refreshed. One way to mitigate that is to have a background process that can cause the cache to be replenished on a regular basis. The trade-off is additional processing that takes place even if no one is viewing the page verses a faster initial display. One technique is to have various pages with different automated refresh times. By adding an include on the time refresh page, that include page is rendered as well. Alternatively, the automation can just have a list of page pages with refresh times. Here is an example of standard refresh times:

...