amazon-s3http-headerscyberduck

Setting cache Expires header to S3 files with Cyberduck


I would like to add Expires header to my images files stored in S3. I have just found out Cyberduck that easily add metadata. However, I would like to add Expires like 1 month after the request (like I do with static files in my webserver with Nginx). I don´t know if this is possible. Otherwise, I can set expires with a date, i.e 1 2018-06-20 but, I think when I get this date, I will need to update all my files with a new date in the future. I would like to set this header "dinamically" one month later. Is it possible? Any other approach?


Solution

  • Set Cache-Control: public, max-age=2592000.

    This will tell the client that the object can be cached for up to 30 days from the time of download.

    Setting Expires is no longer considered best practice, and in any event, S3 only supports a static value, here.