[All Adaptavist Apps]

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Excerpt

This document explains how to improve performance of menus in Builder 2.x and above...

...

Based on common scenarios, the following sequence of tuning tips apply to most sites:

  1. If you don't want to show the View and/or Edit menu to anonymous users, use the hideanon==true setting of the viewmenu macro and/or editmenu macro - this is particularly useful on sites where the vast majority of users are cotent consumers. Remember to provide a link somewhere that allows people to log in!
  2. Disable the "Show icons in the View and Edit menus" setting in Menu Options.
    • If you've turned off menu icons, you can modify your View and Edit menu and delete the menuicon macro references. Obviously, if you wanted to turn them back on at a later date you'd have to add them all in again so download your theme config before making this change.
  3. Modify your View and Edit menus to remove any items that aren't required. For example, most people don't need the Dashboard menu item in the "View > Other Pages" menu because there is a link to the dashboard in the breadcrumb trail.
  4. Enable the "Display menus as quickly as possible" setting in Menu Options - this is particularly useful if you have a huge number of items in your menus.
  5. Disable the "Display shadows behind pop-up menus" setting in Menu Options - this reduces the number of files loaded for menus.
  6. Disable the "Display menu item tool tips" setting in Menu Options - this reduces the amount of processing required (only a tiny amount) to render the menus in the web browser.

...

Using the open source cache macro you can cache any content within Confluence for a specified amount of time. While the content still needs to be downloaded by end-users, the caching reduces the amount of work the server has to do - instead of processing all the wiki notation and macros, it just returns a cached copy of the output.

...

So, while the actual security risk of usig using the cache macro in menus is very low - assuming you have set-up Confluence's privileges correctly - you should be extremely careful when using it because if used incorrectly people will lose confidence in your wiki.

...

Adding cache macros in to your menu notaiton notation makes it harder to maintain - you might get weird errors or artifacts artefacts appearing and not know whether they are related to the cache, the menus or some other aspect of your configuration.

...

Wherever possible, we encourage you to wait until we add that feature before using any form of caching in the menus.

code
Expand
Example - Caching the "Other Pages" menu
Example - Caching the "Other Pages" menu

The view menu has several areas that can be cached and we've provided an example below based on the current structure of the view menu at the time of writing this article.

No Format

{menu}View
 {submenu}{menuicon:document}This page
  {menuitem}{menuicon:document_plain}{menulink:normalView}Normal view{menulink}{menuitem}
  {menuitem}{menuicon:printer}{menulink:printableView}Printable view{menulink}{menuitem}
  {menuseparator}
  {menuitem}{menuicon:pdf}{menulink:exportPDF}Export to Adobe Acrobat (PDF){menulink}{menuitem}
  {menuitem}{menuicon:word}{menulink:exportWord}Export to Microsoft Word{menulink}{menuitem}
  {menuitem}{menuicon:mail}{menulink:exportMail}Export mail to page{menulink}{menuitem}
  {menuseparator}
  {menuitem}{menuicon:about}{menulink:information}%page% information{menulink}{menuitem}
  {menuitem}{menulink:favourite}%add% %page% as favourite{menulink}{menuitem}
  {menuitem}{menulink:watch}%watch% this %page%{menulink}{menuitem}
 {submenu}
 {cache}
 {submenu}{menuicon:documents}Other pages
  {menuitem}{menuicon:house}{menulink:home}Home page{menulink}{menuitem}
  {menuitem}{menuicon:presentation}{menulink:dashboard}Dashboard{menulink}{menuitem}
  {menuseparator}
  {menuitem}{menuicon:news}{menulink:news}News{menulink}{menuitem}
  {menuitem}{menuicon:document_new}{menulink:recent}Recent updates{menulink}{menuitem}
  {menuitem}{menuicon:magic-wand}{menulink:RSS}RSS feed builder{menulink}{menuitem}
  {menuseparator}
  {menuitem}{menuicon:index}{menulink:index}Index{menulink}{menuitem}
  {menuitem}{menuicon:document_into}{menulink:map}Site map{menulink}{menuitem}
  {menuitem}{menuicon:bookmark}{menulink:labels}Labels{menulink}{menuitem}
  {menuseparator}
  {menuitem}{menuicon:paperclip}{menulink:spaceattachments}Attachments index{menulink}{menuitem}
 {submenu}
 {menuseparator}
 {cache}
 {submenu}{menuicon:user1}Account
  {menuitem}{menuicon:id_card}{menulink:profile}Preferences: %user%{menulink}{menuitem}
  {menuitem}{menuicon:user1_into}{menulink:login}Log in{menulink}{menuitem}
  {menuseparator}
  {menuitem}{menuicon:user1_add}{menulink:signup}Sign up{menulink}{menuitem}
  {menuitem}{menuicon:clock}{menulink:history}History{menulink}{menuitem}
  {menuitem}{menuicon:door2}{menulink:logout}Log out{menulink}{menuitem}
 {submenu}
 {menuseparator}
 {menuitem}{menuicon:mail}{menulink:mail}Mail{menulink}{menuitem}
 {menuseparator}
 {menuitem}{menulink:children}Show children (%count%){menulink}{menuitem}
 {menuitem}{menulink:comments}Show comments (%count%){menulink}{menuitem}
{menu}

By caching the "Other Pages" menu, which contains links that are generally available to anyone who can view the space, we've cached the output of 34 macros. Even though those macros don't do much, they still take time to process and when you think of how many times a page is viewed in a single day it's obvious that this will improve performance of your site.

We strongly discourage the use of the cache macro in the Edit menu because every item needs to thoroughly check the privileges of the user viewing the page.