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

clusterSize is ignored. #61

Closed angelcervera closed 4 years ago

angelcervera commented 4 years ago

This is the config that I'm using:

      caching:
        enabled: true
        clusterSize: '13.5'
        ttlInSeconds: 3600
        cacheKeyParameters:
          - name: request.path.param1
          - name: request.querystring.param2

As result, the cache is enable correctly but the cache capacity is 0.5 instead 13.5

sls -v
1.42.3
node --version
v9.11.2

serverless-api-gateway-caching: 1.4.0

https://stackoverflow.com/questions/58137023/serverless-api-gateway-caching-plugin-is-not-setting-the-cache-size

DianaIonita commented 4 years ago

Hi @angelcervera,

You can set the clusterSize on the whole instance under global settings:

custom:
  apiGatewayCaching:
    enabled: true
    clusterSize: '13.5'

You can't define it for each function, because there's only one cache cluster for all functions associated with this Rest API.

angelcervera commented 4 years ago

I'll check it tomorrow. Pretty sure this is the reason. In that case, I will update the documentation and I will create a PR. ok?

DianaIonita commented 4 years ago

I think the documentation is accurate, but I'm curious how you'd like to improve it. Feel free to raise a PR, if you wish.

angelcervera commented 4 years ago

The proposal in the PR. https://github.com/DianaIonita/serverless-api-gateway-caching/pull/62