DianaIonita / serverless-api-gateway-caching

A plugin for the Serverless framework which helps with configuring caching for API Gateway endpoints.
ISC License
136 stars 35 forks source link

Caching stops working as soon as I set cacheKeyParameters #120

Closed pavlelekic closed 1 year ago

pavlelekic commented 1 year ago

Hi, First I want to thank you for the wonderful plugin you have created, it makes my life so much easier. The plugin was working fine until I added the first cache key parameter, here is an example endpoint I have:

  inlineFormLambda:
    name: inlineFormLambda-${env:STAGE}
    handler: ${self:custom.lambdasDir}handlers.inlineFormLambda
    events:
      - http:
          path: /form/{formId}
          method: get
          cors: false
          caching:
            enabled: true
            ttlInSeconds: 3600
            cacheKeyParameters:
              - name: request.path.formId
                required: true

The caching worked fine before I added formId inside cacheKeyParameters, now each time I make a request (with the same formId) I get a new timestamp in response (I added timestamp to be able to detect if the caching is working successfully). Am I doing something wrong? Thanks.

pavlelekic commented 1 year ago

I figured out what the issue was, not related to this plugin.