dougmoscrop / serverless-http

Use your existing middleware framework (e.g. Express, Koa) in AWS Lambda 🎉
Other
1.71k stars 164 forks source link

Cache - help or insights #301

Open jrsarath opened 1 week ago

jrsarath commented 1 week ago

So i been running few tests with serverless-http In aws I'm using API Gateway v1 - Rest api with lambda now when i enable caching on API Gateway, it behaves really weirdly So for instance, here are two paths:

  1. base_path/api/categories
  2. base_path/api/categories/category_id

so without caching all is well, working as expected but when i enable cache, this happens

  1. base_path/api/categories -> returns categories list
  2. base_path/api/categories/category_id -> returns category
  3. base_path/api/categories -> returns the category which was requested on earlier stage

sometimes its even vice-versa

So im not sure where to go from here, TTL is set to 300 api gateway config is /categories/{proxy+} -> ANY -> Lambda + serverless-http

any kind of guidance, insights will be helpfull