mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(caching): integrate with axios cache interceptor [EE-6505] (#10922)
* integrate with axios-cache-interceptor * remove extra headers as not needed
This commit is contained in:
parent
d0b9e3a732
commit
0b9cebc685
8 changed files with 123 additions and 55 deletions
|
@ -216,6 +216,14 @@ async function getApplicationByKind<
|
|||
buildUrl(environmentId, namespace, `${appKind}s`, name),
|
||||
{
|
||||
headers: { Accept: yaml ? 'application/yaml' : 'application/json' },
|
||||
// this logic is to get the latest YAML response
|
||||
// axios-cache-adapter looks for the response headers to determine if the response should be cached
|
||||
// to avoid writing requestInterceptor, adding a query param to the request url
|
||||
params: yaml
|
||||
? {
|
||||
_: Date.now(),
|
||||
}
|
||||
: null,
|
||||
}
|
||||
);
|
||||
return data;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue