Hi there,
I am trying to dynamically create cache policy in request URL before calling DP url open. This is to cache json response of POST request.
I am trying below code in my stylesheet before making dp url open call.
But it is not caching the response, However If i put it in xml manager cache policy, i can see cache entry in document status.
Code-:
<xsl:variable name="cachePolicy">
<allowCompression>on</allowCompression>
<dcp:caching-policies xmlns:dcp="http://www.datapower.com/schemas/caching">
<dcp:caching-policy url-match="{$endpoint}" priority="128">
<dcp:fixed ttl="{$cachetime}" cache-backend-response="true" http-cache-validation="false" return-expired-document="false" restful-invalidation="false" cache-post-put-response="true" />
</dcp:caching-policy>
</dcp:caching-policies> '
</xsl:variable>
<dp:set-variable name="'var://service/mpgw/backend-config'" value="$cachePolicy" />
<xsl:variable name="response">
<dp:url-open target="{$endpoint}" http-method="post" http-headers="$headerValues" content-type="application/x-www-form-urlencoded" timeout="60" response="responsecode-binary" data-type="json">
<xsl:value-of select="$body" />
</dp:url-open>
</xsl:variable>
Can you please guide me what I am missing here.
Many thanks
#DataPower#Support#SupportMigration