I'm calling the backend logic app API and storing the data in cache. Even cache hit the success , outbound policy is calling the backend API and storing the data in the cache. Am i missing something here?
Code for policies used as below
<policies>
<inbound>
<base />
<set-variable name="input" value="@(context.Request.Headers.GetValueOrDefault("flightno",""))" />
<cache-lookup-value key="@((string)context.Variables["input"])" variable-name="flightno" />
</inbound>
<backend>
<base />
</backend>
<outbound>
<base />
<set-variable name="ResponseResult" value="@(context.Response.Body.As<JObject>())" />
<set-variable name="Key" value="@((string)((JObject)context.Variables["ResponseResult"])["flightno"])" />
<set-variable name="payload" value="@((string)((JObject)context.Variables["ResponseResult"]).ToString())" />
<cache-store-value key="@((string)context.Variables["Key"])" value="@((string)context.Variables["payload"])" duration="60" />
</outbound>
<on-error>
<base />
</on-error>
</policies>