serverless-api-gateway-caching icon indicating copy to clipboard operation
serverless-api-gateway-caching copied to clipboard

TTL configs not applied by Api Gateway

Open branst opened this issue 1 year ago • 1 comments

Using the following global config:

apiGatewayCaching: enabled: true clusterSize: '0.5' ttlinseconds: 300

And the folllowing function config:

caching: enabled: true ttlinseconds: 300 perkeyinvalidation:
requireAuthorization: false

Both the API gateway stage and the specific method/function are defaulting to a TTL of 3600 seconds.

Any ideas / suggestions?

branst avatar May 20 '23 00:05 branst

Hi @branst,

Thanks for raising this issue. There are a couple of things you could try.

  • Make sure the plugin is correctly referenced in your package.json and that it's referencing the latest version: [email protected].
  • I'm unsure from your pasted code whether yaml indentation is correct, so you could try disabling caching for your stage, then for your endpoint and seeing if that is reflected in API gateway. If not, then plugin configuration may be incorrect.

Please let me know how that goes.

DianaIonita avatar May 20 '23 19:05 DianaIonita