Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Need to implement Response Caching with request mapping with response

I have following request:

Request with 2 query params: AppID and ObjectID

Request Payload : 

{
    "glossary": {
        "title": "example glossary",
		"GlossDiv": {
            "title": "S",
			"GlossList": {
                "GlossEntry": {
                    "ID": "SGML",
					"SortAs": "SGML",
					"GlossTerm": "Standard Generalized Markup Language",
					"Acronym": "SGML",
					"Abbrev": "ISO 8879:1986",
					"GlossDef": {
                        "para": "A meta-markup language, used to create markup languages such as DocBook.",
						"GlossSeeAlso": ["GML", "XML"]
                    },
					"GlossSee": "markup"
                }
            }
        }
    }
}

Now I want to implement response caching in a way that if the same request comes then APIGEE responds with the corresponding request. The same request is defined as combination of exact same payload and query params.

I want to create a mapping in the APIGEE for request and response and maintain that in APIGEE. But I dont think I can create such a mapping with the help of ResponseCache Policy as I cant keep the request payload as key for it. Please suggest a better approach.

 

Solved Solved
0 3 501
1 ACCEPTED SOLUTION

You could consider hashing the payload? 

With that said, you may also want to think about TPS and payload size of your use case as this could become an intensive operation

View solution in original post

3 REPLIES 3