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

How to add custom metadata e.g "cache-control"? #264

Closed
rioastamal opened this issue Dec 27, 2020 · 4 comments · Fixed by #467
Closed

How to add custom metadata e.g "cache-control"? #264

rioastamal opened this issue Dec 27, 2020 · 4 comments · Fixed by #467

Comments

@rioastamal
Copy link

rioastamal commented Dec 27, 2020

Official AWS CLI does support adding metadata such as --content-type and --cache-control.

$ aws s3 sync ./mydir/ s3://example-bucket/mydir/ \
--content-type 'application/rss+xml; charset=UTF-8' \
--cache-control 'max-age=86400'

The reason I need custom metadata is because I use S3 as static website hosting which sits behind Cloudfront. Setting correct origin headers such as cache-control and content-type for CDN/Proxy is important to my case.

How do I add custom metadata when uploading object using s5cmd? It seems I did not find the options.

@igungor
Copy link
Member

igungor commented Dec 31, 2020

Hi @rioastamal, there's no cache-control support yet. content-type is inferred from the file extension and file content automatically, you can't change it manually.

@rioastamal
Copy link
Author

Hi @igungor, is there any plan to add custom metadata feature in the near future? I really like to use s5cmd because it's faster but that's the only one that blocking me to use it in production.

@nattofriends
Copy link
Contributor

Being able to explicitly set content-type would be very helpful for me as well.

@nattofriends
Copy link
Contributor

(Looks like Cache-Control support was added in #318)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants