Skip to content

Commit 328acd2

Browse files
authored
feat: cache stats api (#75)
1 parent 1b5ca51 commit 328acd2

File tree

3 files changed

+24
-10
lines changed

3 files changed

+24
-10
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"dependencies": {
2626
"all-contributors-cli": "^5.10.1",
2727
"compromise": "^11.13.0",
28-
"probot": "^8.0.0-octokit-16-preview"
28+
"probot": "^8.0.0-octokit-16-preview",
29+
"serverless-api-gateway-caching": "^1.2.2"
2930
},
3031
"devDependencies": {
3132
"@tophat/eslint-config": "^0.1.4",

serverless.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ service: all-contributors-bot
22
frameworkVersion: '=1.35.1'
33

44
plugins:
5+
- serverless-api-gateway-caching
56
- serverless-offline # must be last
67

78
custom:
9+
apiGatewayCaching:
10+
enabled: true
811
stage: ${opt:stage, self:provider.stage}
912
appId:
1013
dev: '23544'
@@ -18,15 +21,6 @@ custom:
1821
sentryDsn:
1922
dev: ''
2023
prod: 'https://[email protected]/1366866'
21-
stageSettings:
22-
CacheClusterEnabled: true
23-
CacheClusterSize: '0.5'
24-
MethodSettings:
25-
- CachingEnabled: true
26-
- HttpMethod: GET
27-
ResourcePath: "/stats"
28-
CachingEnabled: true
29-
CacheTtlInSeconds: 3600
3024

3125
provider:
3226
name: aws
@@ -59,3 +53,6 @@ functions:
5953
path: /stats
6054
method: get
6155
cors: true
56+
caching:
57+
enabled: true
58+
ttlInSeconds: 3600

yarn.lock

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,6 +3669,10 @@ lodash.isboolean@^3.0.3:
36693669
version "3.0.3"
36703670
resolved "https://registry.yarnpkg.com/lodash.isboolean/-/lodash.isboolean-3.0.3.tgz#6c2e171db2a257cd96802fd43b01b20d5f5870f6"
36713671

3672+
lodash.isempty@^4.4.0:
3673+
version "4.4.0"
3674+
resolved "https://registry.yarnpkg.com/lodash.isempty/-/lodash.isempty-4.4.0.tgz#6f86cbedd8be4ec987be9aaf33c9684db1b31e7e"
3675+
36723676
lodash.isinteger@^4.0.4:
36733677
version "4.0.4"
36743678
resolved "https://registry.yarnpkg.com/lodash.isinteger/-/lodash.isinteger-4.0.4.tgz#619c0af3d03f8b04c31f5882840b77b11cd68343"
@@ -3717,6 +3721,10 @@ lodash.sortby@^4.7.0:
37173721
version "4.7.0"
37183722
resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438"
37193723

3724+
lodash.split@^4.4.0:
3725+
version "4.4.2"
3726+
resolved "https://registry.yarnpkg.com/lodash.split/-/lodash.split-4.4.2.tgz#a7f7bd9f37968b9312428e2f3ac3fb3173c4c3c6"
3727+
37203728
lodash.uniq@^4.5.0:
37213729
version "4.5.0"
37223730
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@@ -5058,6 +5066,14 @@ [email protected]:
50585066
parseurl "~1.3.2"
50595067
send "0.16.2"
50605068

5069+
serverless-api-gateway-caching@^1.2.2:
5070+
version "1.2.2"
5071+
resolved "https://registry.yarnpkg.com/serverless-api-gateway-caching/-/serverless-api-gateway-caching-1.2.2.tgz#45a59eb4c2c86ebea2082bd0930099d2c335f626"
5072+
dependencies:
5073+
lodash.get "^4.4.2"
5074+
lodash.isempty "^4.4.0"
5075+
lodash.split "^4.4.0"
5076+
50615077
serverless-offline@^4.0.0:
50625078
version "4.0.0"
50635079
resolved "https://registry.yarnpkg.com/serverless-offline/-/serverless-offline-4.0.0.tgz#3ba9fe467ed6b7a0e4661160b2d7929bd5ca03df"

0 commit comments

Comments
 (0)