Geographic Caching of Jira Cloud API

I am periodically polling the Jira API to determine story points by status. I will occasionally get values that do not align with the statuses in Jira. While troubleshooting, I will invoke the function from a server running in a cloud environment, as well as from my local development environment. I will get the correct data when running locally, and get stale/outdated data when invoking the function from the server.

Is there caching that is impacting the results from the server, and is there a way to bust the cache and get the most current data?

I can recreate this by just curl-ing the url below by ssh-ing in to the server vs hitting the url from my local machine. Why would I get different results based on the machine?

export const getSprintIssues = async (sprintId: number, startAt: number) => {
  const url = `https://<company>.atlassian.net/rest/agile/1.0/sprint/${sprintId}/issue?startAt=${startAt}`;
  const config: AxiosRequestConfig = {
    headers: {
      Accept: 'application/json',
      Authorization:
        'Basic <auth-token>',
    },
  };
  const { data } = await axios.get(url, config);

  return data;
}

Hello @el-kevino

Your question is tagged with Jira CLOUD, but you talk about a “server in a cloud environment” which sounds like Jira DATA CENTER, which is a totally different product.

Next, you talk about a ‘Local development environment’ and you mention a ‘server’ but don’t say what or where that is, IE it could be an instance of the old Jira SERVER product or an instance of the newer Jira DATA CENTER product, and ‘local’ could mean “on my laptop” or “In a VM” or “In a Container” or “In a VM’d local server” etc etc.

Lastly, you don’t provide any information as to how the dev and prod systems are being kept in sync or aligned so as to keep their databases identical. In the absence of any syncing, then of course data from one will be different to data from the other and the results from the REST API queries are just proof of that. If they are being synced, that is normally done to a schedule and you might be just making queries between syncs when the data hasn’t been aligned yet.

You should talk to your sys admins first to at least know what product is being used and how it’s being operated.

Hello @sunnyape -

We do not have any on-premises/legacy systems. Our only Jira services are Atlassian-hosted Jira CLOUD. When I referenced the “server in a cloud environment”, I was referring to the Linode-hosted server that is polling the API of our Jira cloud instance. I am able to SSH in to the Linode box and get a different response from the API than I do if I run the query from my local dev environment (simple nodejs app that queries the API and does some aggregations).

There are not any dev instances (of Jira). I develop the nodejs app locally, and then deploy it to a server at Linode.

What is confusing is that I get different responses to the same request… with the only difference being the location from which the request is made. Which has me thinking that there is some kind of caching taking place.

OK, now it’s getting clearer. If you do a GET request to the Jira Cloud instance directly and bypass the Linode server, that should be the current and correct data, since the REST API does absolutely no native caching.

If you then poll the same endpoint via the Linode server and get slightly out of date data, then you have your culprit.