Support for `cacheKeyParameters` per QueryStringParameter
Closed this issue · 3 comments
gligorkot commented
Love this plugin! It is super valuable and very quick to set up.
One thing that would be great to add is support for queryStringParameters
in the cacheKeyParameters
property.
Thank you!
DianaIonita commented
Thanks @gligorkot!
You should already be able to specify query string parameters as cache keys, like this:
# Responses are cached based on the 'breed' query string parameter
get-cats-by-breed:
handler: rest_api/cat/get/handler.handle
events:
- http:
path: /cats
method: get
caching:
enabled: true
cacheKeyParameters:
- name: request.querystring.breed
gligorkot commented
@DianaIonita oh cool! I tried query
and querystringparameter
, but not just querystring
hehehe.
Perhaps adding this to the Readme would help then?
Edit: I just saw it in the Readme 🤦♂ how could I have missed that???
Thanks for pointing me to it.
DianaIonita commented
No worries - a bit hard to spot to be fair, cache key parameters probably need a section of their own.