How to bypass the caching mechanism for Jira Issues Macro in Confluence


プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。

*Fisheye および Crucible は除く

要約

When a page with a Jira Issue Macro is loaded, the response from Jira is stored in Confluence's cache.

This cache has a time to live (TTL) based on what is configured in <Confluence Base URL>/admin/jim/cachesettings.action. The default value is 5 minutes.

If the same Jira Issue Macro is loaded within this time, then Confluence will get the information from the cache instead of going to the Jira server.

If any issue from the target JQL changes within that interval, then you won't get the update in the Confluence page, since it will be relying on the cache.

ソリューション

There are several ways we can bypass the caching mechanism for the Jira Issues Macro:

Macro Refresh Button

The Confluence user may click on the Refresh button within the macro – this is not the browser's refresh button.

When that button is clicked, it will send the request directly to Jira and then update the Confluence cache with recent information.

Cache Parameter

The Jira Issues Macro has a configuration parameter on the macro level that tells Confluence to bypass the cache and always contact Jira when loading information.

This parameter is not available in the UI and can only be added or changed if editing the page with the Confluence Source Editor App.

As explained in Jira Issues Macro:

パラメーター名必須既定パラメーターの説明と指定可能な値
キャッシュいいえオン

マクロは、JIRA クエリの結果の課題のキャッシュを保持します。'cache' パラメーターが 'off' に設定されている場合、キャッシュの関連部分は、マクロが再度ロードされるたびにクリアされます。(値 'false' も使用でき、 と同じ効果があります。)

注: このパラメーターはページのストレージ形式を編集することで、Wiki マークアップ経由でマクロを挿入した場合にのみ使用できます。マクロ ブラウザはこのパラメーターを提供しません。


Example of the storage format for a Jira Macro with the cache parameter set to false:

<ac:structured-macro ac:macro-id="4cbe8338-d55c-4298-970e-76f699b326fd" ac:name="jira" ac:schema-version="1">
    <ac:parameter ac:name="server">Jira</ac:parameter>
    <ac:parameter ac:name="serverId">d0cc468a-9f3a-3e58-9252-9728b6f22732</ac:parameter>
    <ac:parameter ac:name="key">TEST-1</ac:parameter>
    <ac:parameter ac:name="cache">false</ac:parameter>
  </ac:structured-macro>


Global Settings

If the Confluence Administrator is fine with bypassing the cache for all Jira Issues Macros within the Confluence instance, then the cache time to live can be set to 0 in <Confluence Base URL>/admin/jim/cachesettings.action.

Note that this can degrade Confluence and Jira performance since it will reach the Jira server through the network every time a Jira Issues Macro is loaded.

Any change on this page will require Confluence to be restarted so it uses the new value.


最終更新日: 2020 年 10 月 13 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.