Merge pull request #9 from jrbenito/pass-headers-nt3rp

Pass headers to s3-sync to be able to set metadata in objects
This commit is contained in:
Nicholas Terwoord
2016-12-13 23:49:03 -05:00
committed by GitHub
3 changed files with 31 additions and 5 deletions

View File

@@ -21,11 +21,28 @@ deploy:
aws_secret: <AWS secret key> // Optional, if the environment variable `AWS_SECRET_ACCESS_KEY` is set
concurrency: <number of connections> // Optional
region: <region> // Optional, see https://github.com/LearnBoost/knox#region
headers: <headers in JSON format> // pass any headers to S3, usefull for metadata cache setting of Hexo assets
```
#### Example: header Cache-Control
``` yaml
deploy:
type: s3-cloudfront
bucket: my-site-bucket
cf_distribution: mydistributionid
headers: {CacheControl: 'max-age=604800, public'}
```
This will set "Cache-Control" header in every file deployed to max-age 1 week. This solves "Leverage browser caching" on most page speed analyzers. For custom metadata use:
``` yaml
headers: {Metadata : { x-amz-meta-mykey: "my value" }}
```
## Contributors
- Josh Strange ([joshstrange](https://github.com/joshstrange); original implementation)
- Josenivaldo Benito Jr. ([JrBenito](https://github.com/jrbenito))
## License