Confluence Data Center Caching with temp files (images)

Hi,

I’ve created and published an open source plugin for connecting to Databases (https://bitbucket.org/keysight/keysight-plugins-for-atlassian-products/wiki/Confluence%20Plugins/Database%20Plugin) I recently decided to try to add the ability to cache the results. Didn’t seem to hard - and so I made the “Macro Results Cache” plugin to just cache the body of any macro. Also, didn’t seem to hard. I can now cache the output from the Chart Macro rather than the Database Query macro generating the table that feeds the Chart Macro. This all works fine in the Data Center environment with one exception - in my setup (which I’m not 100% sure is correct), each instance of Confluence is generating the image into independent temp folders instead of the shared data folder. So, when first viewed, the images will be generated and the urls to them cached. When viewed on the other instance, the cached results are returned but the actual files are not available. Any clues to work around this (or perhaps I just setup my Confluence Data Center wrong?)

1 Like

So, I figured out a solution. There is a CacheManager that will give a unique id for the node you are using. So I just ended up having a cache entry per node. When clearing the value, the CacheManager also has a method to get all of the unique node id’s, so I clear all values for the various nodes.

1 Like