Search code examples
ruby-on-railsrubyruby-on-rails-3amazon-web-servicesamazon-cloudfront

Cloudfront on rails not showing new images


I'm using cloudfront as my CDN in my Rails app. I created my distribution and changed the enviroment file to enable the asset host.

Everything was working fine until I made a new deploy that included 3 new images. After restarting, everything looks fine but the 3 images. If I get the cloudfront URL and change the domain for my rails app domain the images load just fine, but if I use the CloudFront domain the images look like they weren't found.

Any ideas why this is happening? If I undestand correctly CloudFront doesn't have a delay, it loads the image as soon as the first request comes in.


Solution

  • I found the problem. Sometime between the precompile and the restart of the server someone made a request and Cloudfront couldn't find the image so that's why it wasn't showing. I changed the image name, re-depoyed it and everything is fine now.