How to automate cache refresh -7.x
Summary
Using the cache macro really improves display performance for viewers of the page. At some point, the cache will expire and will need to be refreshed. The first viewer to access the page after expiry will have to wait. To avoid this so that every page view is quick, you can automate the cache refresh. This describes the steps necessary to do this. This support is based on the refresh=true request parameter that is supported by the Cache macro to refresh all cache macros found on the page.
Steps
- Determine the appropriate refresh intervals for each of the pages you need to automate. For example, I have used the following categories: 15m, 1h, 3h, 24h.
- Make up label names that correspond to the categories. For example, cache_15m, cache_1h, cache_3h, cache_24h.
- Add one of the labels to each of the pages that need to be automated.
- Make sure the refresh time parameter for each cache macro is longer than the automated time to allow the automation to refresh the page before a viewer hits the page.
Add the following Confluence Command Line Interface (CLI) action to your favorite job scheduler - one for each category determined above.Â
--action runFromPageList --labels cache_15m --common "-a renderRequest --requestParameters refresh=true --title @home --space experiment --file \"\" "
Bamboo
It is even better if you have Bamboo already or install a simple Bamboo server to run the automation. In this case, the Run CLI Actions in Bamboo can be used. It provides a Confluence CLI task that can run the action mentioned above. Schedule a build (one for each category) on the schedule corresponding to the category.
Confluence®, Jira®, Atlassian Bamboo®, Bitbucket®, Fisheye®, and Atlassian Crucible® are registered trademarks of Atlassian®
Copyright © 2005 - 2024 Appfire | All rights reserved. Appfire™, the 'Apps for makers™' slogan and Bob Swift Atlassian Apps™ are all trademarks of Appfire Technologies, LLC.