Skip to content

Commit

Permalink
Add CacheControl for fixing the bug on CloudFront
Browse files Browse the repository at this point in the history
There are 2 issues related to Cyclic redirect when using CloudFront
#5
#7
This commit adds the Cache-Control header to prevent that
  • Loading branch information
kofon95 committed Nov 20, 2019
1 parent c2f7f1f commit f63be94
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ exports.handler = async (event) => {
Body: result,
Bucket: BUCKET,
ContentType: data.ContentType,
Key: path
Key: path,
CacheControl: 'public, max-age=86400'
}).promise();

return {
Expand Down
2 changes: 1 addition & 1 deletion package.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "s3-resizer",
"version": "3.0.0",
"dependencies": {
"sharp": "^0.23.1"
"sharp": "^0.23.3"
},
"devDependencies": {
"aws-sdk": "^2.36.0"
Expand Down

0 comments on commit f63be94

Please sign in to comment.