ResponseCache SkipCachePopulation based on the content in the target response

Is it possible to skip populating the cache based on the response of the target server?  The target server should response with a Http status of 200 and a json object that includes a status property.  I have put in my policy <SkipCachePopulation>(response.content.status == "FAIL")</SkipCachePopulation>.  However regardless of the value of the status property the cache is alway populated.

Sample Target Service Response

{

"status": "FAILED",

"message": "Something bad happened"

}

Solved Solved
0 2 156
1 ACCEPTED SOLUTION

The problem turned out to be the target server was returning text/html even though the request was for application/json.  Added a step to change the response to json then an extract variable policy to read said json worked.

View solution in original post

2 REPLIES 2

The problem turned out to be the target server was returning text/html even though the request was for application/json.  Added a step to change the response to json then an extract variable policy to read said json worked.

Outstanding, thanks for the followup.