Search code examples
amazon-web-servicescachingamazon-s3amazon-cloudfrontcache-control

Amazon S3 images cache-control not being applied


I searched all over and found a method to cache images on Amazon S3. Whenever I upload an image, I add a meta element of cache-control and then set max-age=86400. However, on any sort of speed test site it says that my images do not have a cache applied to them.

I am not sure if it matters, but I have CloudFront linked to this S3 bucket. Sorry, but completely new to AWS.

Anyone know why my images may not be caching?

enter image description here

enter image description hereenter image description here


Solution

  • on any sort of speed test site it says that my images do not have a cache applied to them.

    That isn't what this says. The screenshot says they have a short freshness lifetime, and longer than 1 week is recommended.

    Your setting of max-age=86400 is only 24 hours.