serverless-api-gateway-caching
Advanced tools
Comparing version 1.6.0 to 1.6.1
{ | ||
"name": "serverless-api-gateway-caching", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "A plugin for the serverless framework which helps with configuring caching for API Gateway endpoints.", | ||
@@ -5,0 +5,0 @@ "main": "src/apiGatewayCachingPlugin.js", |
@@ -67,3 +67,3 @@ const get = require('lodash.get'); | ||
this.dataEncrypted = cachingConfig.dataEncrypted || globalSettings.dataEncrypted; | ||
this.cacheTtlInSeconds = cachingConfig.ttlInSeconds || globalSettings.cacheTtlInSeconds; | ||
this.cacheTtlInSeconds = cachingConfig.ttlInSeconds >= 0 ? cachingConfig.ttlInSeconds : globalSettings.cacheTtlInSeconds; | ||
this.cacheKeyParameters = cachingConfig.cacheKeyParameters; | ||
@@ -84,3 +84,5 @@ | ||
this.cachingEnabled = globalSettings.cachingEnabled ? get(caching, 'enabled', false) : false; | ||
this.cacheTtlInSeconds = get(caching, 'ttlInSeconds', globalSettings.cacheTtlInSeconds); | ||
if (caching) { | ||
this.cacheTtlInSeconds = caching.ttlInSeconds >= 0 ? caching.ttlInSeconds : globalSettings.cacheTtlInSeconds; | ||
} | ||
this.dataEncrypted = get(caching, 'dataEncrypted', globalSettings.dataEncrypted); | ||
@@ -111,3 +113,3 @@ } | ||
this.cacheClusterSize = cachingSettings.clusterSize || DEFAULT_CACHE_CLUSTER_SIZE; | ||
this.cacheTtlInSeconds = cachingSettings.ttlInSeconds || DEFAULT_TTL; | ||
this.cacheTtlInSeconds = cachingSettings.ttlInSeconds >= 0 ? cachingSettings.ttlInSeconds : DEFAULT_TTL; | ||
this.dataEncrypted = cachingSettings.dataEncrypted || DEFAULT_DATA_ENCRYPTED; | ||
@@ -114,0 +116,0 @@ |
@@ -152,2 +152,6 @@ const isEmpty = require('lodash.isempty'); | ||
const updateStageFor = async (serverless, params, stage, region) => { | ||
if (params.patchOperations.length == 0) { | ||
serverless.cli.log(`[serverless-api-gateway-caching] Will not update API Gateway cache settings because apiGatewayIsShared is set to true.`); | ||
return; | ||
} | ||
const chunkSize = MAX_PATCH_OPERATIONS_PER_STAGE_UPDATE; | ||
@@ -154,0 +158,0 @@ const { patchOperations } = params; |
37297
571