From b54b29a5dee0f42a9c32ec6c49a9e5a3faab10a8 Mon Sep 17 00:00:00 2001 From: apoca Date: Sat, 9 May 2020 00:27:04 +0100 Subject: [PATCH] Improved image cache-control to 1y --- CHANGELOG.md | 9 ++++++++- package.json | 2 +- src/handler.js | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae7f4b2..a6dc40e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [2.2.0] - 2020-05-09 + + ### Changed + + - Improved image cache-control to 1y + ## [2.1.0] - 2020-05-08 ### Changed @@ -87,7 +93,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Starting develop unit test with jest -[unreleased]: https://github.com/apoca/lambda-resize-image/compare/v2.1.0...HEAD +[unreleased]: https://github.com/apoca/lambda-resize-image/compare/v2.2.0...HEAD +[2.2.0]: https://github.com/apoca/lambda-resize-image/compare/v2.1.0..v2.2.0 [2.1.0]: https://github.com/apoca/lambda-resize-image/compare/v2.0.1..v2.1.0 [2.0.1]: https://github.com/apoca/lambda-resize-image/compare/v2.0.0..v2.0.1 [2.0.0]: https://github.com/apoca/lambda-resize-image/compare/v1.3.3..v2.0.0 diff --git a/package.json b/package.json index 9848963..58cd9d0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lambda-resize-image", - "version": "2.1.0", + "version": "2.2.0", "description": "An AWS Lambda Function to resize images automatically with API Gateway and S3 for imagemagick tasks. When an image is called on AWS Api Gateway, this package will resize it and send it to the S3.", "main": "src/handler.js", "engines": { diff --git a/src/handler.js b/src/handler.js index 5c0a720..b62d725 100644 --- a/src/handler.js +++ b/src/handler.js @@ -66,6 +66,7 @@ export function imageprocess(event, context, callback) { statusCode: 200, headers: { 'Content-Type': 'image/jpeg', + 'Cache-Control': 'public, max-age=31536000', }, body: buffer.toString('base64'), isBase64Encoded: true, @@ -111,6 +112,7 @@ export function imageprocess(event, context, callback) { statusCode: 200, headers: { 'Content-Type': 'image/jpeg', + 'Cache-Control': 'public, max-age=31536000', }, body: buffer.toString('base64'), isBase64Encoded: true,