Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for AWS S3 cache control headers #45

Merged
merged 1 commit into from
Oct 13, 2015

Conversation

Starefossen
Copy link
Contributor

Add support for Expires and Caceh-Control headers for images uploaded to AWS S3. It is good practice to cache as much as possible and adding the headers retrospectively to AWS is kind of a pain.

Usage:

    {
      maxHeight: 100
      aspect: '1:1'
      format: 'png'
      suffix: '-thumb1'
      awsImageExpires: 31536000
      awsImageMaxAge: 31536000
    }

@DavidBennettUK I upstreamed your changes, I hope you are ok with that.

Signed-off-by: Hans Kristian Flaatten [email protected]

@Starefossen Starefossen self-assigned this Sep 22, 2015
@Starefossen Starefossen added this to the v1.1.0 milestone Sep 22, 2015
Starefossen pushed a commit that referenced this pull request Sep 22, 2015
Add support for `Expires` and `Caceh-Control` headers for
images uploaded to AWS S3. It is good practice to cache as
much as possible and adding the headers retrospectively to
AWS is kind of a pain.

PR-URL: #45

Signed-off-by: Hans Kristian Flaatten <[email protected]>
@anthonyringoet
Copy link
Contributor

Nice one!

@anthonyringoet
Copy link
Contributor

Do you have an idea when this will land in a new release on npm?

@@ -78,9 +78,13 @@ var Upload = require('s3-uploader');
* **string** `background` - set background for transparent images (**example:** `red`)
* **boolean** `flatten` - flatten backgrund for transparent images
* **string** `awsImageAcl` - access control for AWS S3 upload (**example:** `private`)
* **number** `awsImageExpires` - add `expirex` header to image version
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expirex => Expires

@Starefossen
Copy link
Contributor Author

I think enough time has passed to merge and release this feature 👍

Add support for `Expires` and `Caceh-Control` headers for
images uploaded to AWS S3. It is good practice to cache as
much as possible and adding the headers retrospectively to
AWS is kind of a pain.

PR-URL: #45

Signed-off-by: Hans Kristian Flaatten <[email protected]>
@Starefossen Starefossen force-pushed the feature/cache-control branch from f223434 to 1661b5a Compare October 13, 2015 18:18
@Starefossen Starefossen merged commit 1661b5a into master Oct 13, 2015
@Starefossen
Copy link
Contributor Author

@anthonyringoet
Copy link
Contributor

Cool, thanks! ⚡

@Starefossen Starefossen deleted the feature/cache-control branch October 13, 2015 18:57
Starefossen pushed a commit that referenced this pull request Oct 28, 2015
Add support for `Expires` and `Caceh-Control` headers for
images uploaded to AWS S3. It is good practice to cache as
much as possible and adding the headers retrospectively to
AWS is kind of a pain.

PR-URL: #45

Signed-off-by: Hans Kristian Flaatten <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants