Versions Compared

Key

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

Table of Contents
maxLevel3
minLevel3
typeflat
separatorpipe

...

Summary

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

...

Excerpt

hints and tips for improving performance to render complex pages

.

Rendering

Render is the Confluence process that takes page markup and converts it into html that is sent to the browser. In simple terms, the time taken to display the page in the browser is determined by:

  1. Server processing - Confluence server processing that converts page markup into html
  2. Download time - to transfer the html and all referenced images, scripts, and related information to the browser
  3. Browser - rendering time

Constraints

Cache for Confluence is constrained by

...

:

  1. The amount of CPU needed to do the server work - this is primarily a single threaded activity and can only be improved by single processor rates.
  2. is constrained by communications Communications bandwidth which can be variable depending on time and location.
  3. is constrained by browser Browser performance with FireFox considered to be generally faster than Internet Explorer (IE).

Factors to address

...

Cache for Confluence is:

  1. Most impacted by page construction techniques to reduce processing load.
  2. is addressed Addressed by reducing the size of the rendered text and images.
  3. is addressed Addressed by browser options (caching) and by pages that best optimize browser capabilities (like caching).

Server processing

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
titleDelayed rendering

This is a technique to allow the browser to display the page while processing continues with the rendering of portions of page data. Use the future macro to delay processing of portions of the page. These areas of the page will show display a loading message until the data is available from the server and then will automatically be shown.

Extracting data from other systems via SQL or other techniques can take a significant amount of time. Similarly for metadata reporting. Is the data static or dynamic? Does it need to be current to the second or just to the day, week, or month?

Tip
titleUse caching

The Cache macroMacro 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 will be waiting 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).

...

Note
titleAttachments

The cache macro is smart enough to invalidate the cache if you edit the contents within the cache macro. It also invalidates the cache if any attachments are changed on the page. For example, if a newer version of the excel spreadsheet is attached, the cache will be is invalidated automatically and the new spreadsheet data will be is brought in. There is a parameter that controls this behavior - checkAttachments that has a default value of true to cover the case just mentioned above. However, attachment checking should be turned off (checkAttachments=false) if this feature is not needed and MUST be turned off if taking advantage of chart attachments (see below)!

...

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 will can be viewed by a different user at a later time. This also applies to references to data or attachments from other pages - 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.

...

Tip
titleLet user control information request

Use the Run macro to provide a simple dialog for the user to request data. Once the user requests the data, the data will be is rendered and presented based on the parameters the user provides.

...

The caching techniques above also help with browser performance. Browser will be able to locally cache caches static images.

Tip
Use FireFox
Use FireFox

FireFox is generally viewed as performing better that IE. Make sure you are using the latest browser (no matter what your browser choice).

...

  1. Use the cache macro:
    • refresh=1h - this means the data will be is retrieved if older than 1 hour
    • checkAttachments=false - this says the cache will be is used even if attachments have been changed on the page
  2. Add the following parameters to your chart macro:
    • attachment=your attachment name.png - this stores the chart image as an attachment to the page (or optionally another page)
    • attachmentVersion=replace - this tells the chart macro to replace the attachment that represents the chart

How can the data be regenerated? It is the same case as just using the chart macro.

Mixture of static and dynamic data

...

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 will be is rendered as well. Alternatively, the automation can just have a list of page with refresh times. Here is an example of standard refresh times:

...