I have a few pages that combine and process other Confluence pages using some or all of:
* Table Transformer
* Page Properties report
* Table Excerpt Include
I find that when I make manual data entry updates to the source of those tools, the calculated content is only refreshed when the page containing the calculations is viewed in a web browser.
I.e., if I make updates on the source pages, and use the REST API to query the calculated page from a script (e.g. https://confluence.XYZ/rest/api/content/760043385?expand=body.export_view) the content is not up to date. It also does not update if this request is made in a browser.
I've also tried fetching the calculated page from the script as if I were a browser, e.g. https://confluence.XYZ/pages/viewpage.action?pageId=754347379, and passing [NoCache = true] in the header. Still no luck.
As soon as I visit the page in a browser (or hit F5 to refresh it), the API query returns updated data.
Is this behaviour as expected, or is there something I am not doing that will make the API content as fresh as the browser's content?
The C# code looks something like this:
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", personalAccessToken);
client.DefaultRequestHeaders.CacheControl = new CacheControlHeaderValue{NoCache = true};
var pageUrl = confluenceRestApiBaseUrl + pageId;
if (!String.IsNullOrEmpty(parameters))
{
pageUrl += "?" + parameters;
}
var response = await client.GetAsync(pageUrl);
response.EnsureSuccessStatusCode();
var json = await response.Content.ReadAsStringAsync();
}
Hi @Jan van der Watt ,
The behavior is an expected one: the updates should be rendered in a browser. You may try to create a script that may automatically open your browser and refresh the required page.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.