s3-website icon indicating copy to clipboard operation
s3-website copied to clipboard

How to specify "Cache-control" max-expires for objects

Open vladejs opened this issue 6 years ago • 6 comments

Hi, when deploying a site, I enable cloudfront for them with the option to redirect http -> https requests.

Problem is that the 301 redirect is permanently cached in chrome. Surfing the web I found that settings "Cache-control"/max-expires headers to S3 objects avoids the caching, so I would like to know if that's possible with this library

vladejs avatar Oct 13 '17 16:10 vladejs

The original maintainer did most of the work surrounding cloudfront. I am not as knowledgable. I am a little bit unsure of what you are asking exactly. Ae you wanting to know if you can set custom Cache-Control for pages on your site?

nick-benoit14 avatar Oct 13 '17 16:10 nick-benoit14

Exactly, yes. Put cache-control to objects uploaded to S3 (nothing to do with cloudfront, I was just explaining why I need to set the Header)

vladejs avatar Oct 13 '17 16:10 vladejs

I don't believe there is a way to do that currently. That would be a good feature though.

nick-benoit14 avatar Oct 13 '17 16:10 nick-benoit14

do you know how / have the time to implement it?

vladejs avatar Oct 13 '17 18:10 vladejs

I am not 100% certain that s3 supports it. I probably do not have time to implement it in a timely manner. I would like to add it down the road however.

nick-benoit14 avatar Oct 13 '17 19:10 nick-benoit14

S3 supports setting custom headers on objects

2017-10-13 15:58 GMT-04:00 Nick Benoit [email protected]:

I am not 100% certain that s3 supports it. I probably do not have time to implement it in a timely manner. I would like to add it down the road however.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/klaemo/s3-website/issues/42#issuecomment-336552644, or mute the thread https://github.com/notifications/unsubscribe-auth/AMDUAnKkjbripN93BuJnTud5fo5G0do3ks5sr8DdgaJpZM4P4txD .

vladejs avatar Oct 13 '17 20:10 vladejs