Search code examples
cdnamazon-cloudfront

Do Cloudfront images expire?


We are using Amazon cloudfront to serve static files from our website. We are copying these image references to another database on a mobile app, so that the images in the app are served from Cloudfront as well, so we need the URL to be permanent.

A URL for an image on our site looks something like this: http://d3q35tken14acg.cloudfront.net/cdn/farfuture/M17vstJzweaXVBR4penpg6CEv_v8DwxSKZIqZKlR6rY/mtime:1493753067/sites/unfestival/files/Screen%20Shot%202017-05-02%20at%2020.18.53.png

The mtime:1493753067 in the URL makes me wonder if the URL will expire.

My question: do URLs like this expire, or are they permanent?


Solution

  • The way CloudFront works can be a bit confusing, but the cache applies over the file content, not the URL. It's intended to be used for CDNs and such, where URLs need to be static, and it just ensures you can retrieve the files from a nearby region, reducing latency.

    So basically Cloudfront URLs shouldn't expire for most of the cases.