question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[codepipeline-actions] max-age header not set correctly for s3 deploy action

See original GitHub issue

The 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:

https://github.com/aws/aws-cdk/blob/8d5b801971ddaba82e0767c74fe7640d3e802c2f/packages/%40aws-cdk/aws-codepipeline-actions/lib/s3/deploy-action.ts#L33

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:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
skinny85commented, Jul 7, 2020

@skinny85 I have opened a PR, would be amazing if this can go in as it is breaking the interwebs 😄

Approved - I don’t want to keep the interwebs waiting! 😅

Thanks so much for taking care of this issue @nonken !

0reactions
nonkencommented, Jul 8, 2020

🤗 Wohoo!!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found