【问题标题】:serverless-api-gateway-caching plugin is not setting the cache sizeserverless-api-gateway-caching 插件未设置缓存大小
【发布时间】:2019-10-01 20:28:11
【问题描述】:

我尝试使用 serverless-api-gateway-caching 插件设置 AWS API Gateway 缓存。

一切正常,除了 cacheSize。

这是我的缓存配置:

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

缓存配置正确,但缓存大小始终是默认的'0.5'

知道哪里出了问题吗?

sls -v
1.42.3
node --version
v9.11.2
serverless-api-gateway-caching: 1.4.0

问候

【问题讨论】:

    标签: serverless-framework


    【解决方案1】:

    由于“缓存容量”设置是每个阶段全局的,因此无法针对每个端点进行设置。

    所以插件只会在无服务器全局配置中检查这个参数,在端点级别忽略它。

    表示正确的配置是:

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

    【讨论】:

      猜你喜欢
      • 2022-10-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-05-25
      • 2017-12-09
      • 1970-01-01
      相关资源
      最近更新 更多