serverless-api-gateway-caching
Advanced tools
Comparing version 1.0.0-rc17 to 1.0.0-rc18
{ | ||
"name": "serverless-api-gateway-caching", | ||
"version": "1.0.0-rc17", | ||
"version": "1.0.0-rc18", | ||
"description": "A plugin for the serverless framework which helps with configuring caching for API Gateway endpoints.", | ||
@@ -5,0 +5,0 @@ "main": "src/apiGatewayCachingPlugin.js", |
@@ -20,4 +20,4 @@ # serverless-api-gateway-caching | ||
enabled: true | ||
clusterSize: '0.5' | ||
ttlInSeconds: 300 | ||
clusterSize: '0.5' # defaults to '0.5' | ||
ttlInSeconds: 300 # defaults to the maximum allowed: 3600 | ||
@@ -24,0 +24,0 @@ functions: |
@@ -22,2 +22,4 @@ const isEmpty = require('lodash.isempty'); | ||
constructor(serverless, options) { | ||
const DEFAULT_CACHE_CLUSTER_SIZE = '0.5'; | ||
const DEFAULT_TTL = 3600; | ||
if (!get(serverless, 'service.custom.apiGatewayCaching')) { | ||
@@ -38,4 +40,4 @@ return; | ||
this.cacheClusterSize = serverless.service.custom.apiGatewayCaching.clusterSize; | ||
this.cacheTtlInSeconds = serverless.service.custom.apiGatewayCaching.ttlInSeconds; | ||
this.cacheClusterSize = serverless.service.custom.apiGatewayCaching.clusterSize || DEFAULT_CACHE_CLUSTER_SIZE; | ||
this.cacheTtlInSeconds = serverless.service.custom.apiGatewayCaching.ttlInSeconds || DEFAULT_TTL; | ||
@@ -42,0 +44,0 @@ for (let functionName in serverless.service.functions) { |
13939
278