Is it Possible to have the API Manager Cache Results when Query String Arguments Are Passed?
I have a resource I have set up in one of my APIs, which the user may call with different arguments to augment the result set. For example, the user may want to pull back all of the objects in the database. In this case, no arguments are sent and all items are returned. But, they may also want a specific category and they may want to limit the results to a certain number. If they provide a query string argument for category and another for limit, the web service responds accordingly. They may also want to retrieve just one record. If they pass an ID for the record, the web service just pulls back that one record.
The trouble comes in when I implement caching for the API. After the response is cached for any set of arguments, it doesn't matter if I change the arguments, it still only pulls back the cached result set it originally returned when the cache was set.
Is there any way I can get it to behave more like query caching in ColdFusion, where it will cache separate result sets when different arguments are passed?
UPDATE: After looking more closely at RESTful standards and practices, I decided to give this a try as a POST method, passing a JSON string with the filter data I need for this query. I thought that might help with the caching issue, but it doesn't seem to have made a difference. Whatever parameters I send in JSON, it sends back the data it cached on the first attempt to the endpoint.
Any help or suggestions are appreciated here.
