[codepipeline-actions] max-age header not set correctly for s3 deploy action
See original GitHub issueThe Cache-Control max-age key value gets set wrongly when using an S3DeploymentAction.
Current max-age: Number
Expected max-age=Number
Thanks to the excellent and super fast triage from @mikesherov 🙏.
https://twitter.com/mikesherov/status/1277320422791528457
The faulty line can be found here:
The same applies for the s-maxage
property: https://github.com/aws/aws-cdk/blob/8d5b801971ddaba82e0767c74fe7640d3e802c2f/packages/%40aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts#L35
Also see here https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control
Reproduction Steps
new S3DeployAction({
cacheControl: [CacheControl.maxAge(Duration.days(365))]
});
Environment
- CLI Version : 1.47.0
- Framework Version:
- Node.js Version:
- OS :
- Language (Version):
Other
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
AWS CDK - class CacheControl
Constructs a custom cache control key from the literal value. static maxAge(t), Sets 'max-age=<duration-in-seconds>'. static mustRevalidate(), Sets ...
Read more >How to set cache-control to max-age=0 with github s3 sync ...
The result I am looking for is that the index. html has another metadata Cache-Control: max-age=0 after every deployment. At the moment I...
Read more >@aws-cdk/aws-s3-deployment | Yarn - Package Manager
The source bucket/key is set to point to the assets bucket. The custom resource downloads the .zip archive, extracts it and issues aws...
Read more >s3-deploy - npm
Use this parameter to specify the Cache-Control: max-age=X header, where X is the number of seconds a given item will be kept in...
Read more >Production deploy of a Single Page App using S3, CloudFront ...
Uploading static content with correct caching headers ... aws s3 sync --cache-control 'max-age=604800' --exclude index.html build/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Approved - I don’t want to keep the interwebs waiting! 😅
Thanks so much for taking care of this issue @nonken !
🤗 Wohoo!!