Search code examples
cachingamazon-web-servicesdeploymentamazon-s3amazon-cloudfront

AWS CDN Expire after caching vs deploy


How do I set an AWS CDN to expire after being cached in the user's browser?

The current method expires after it is deployed...

Expires: new Date(new Date().getTime() + (1000 * 60 * 60 * 24 * 7))

Using Javascript.


Solution

  • I suggest using Cache-Control: max-age=seconds instead of absolute time if I understand your question correctly.