I'm using S3 to store a bunch of images and CloudFront to cache them. The problem I'm getting is that my images are not being cached correctly.
If I check the headers for an image through the CloudFront link, it will show a MISS on the first try and HIT for all subsequent tries. This is normal, but if I close my browser, go away for a few hours and try it again it will show a MISS. Therefore indicating that it's only getting cached for short period.
Here's a sample image on the cdn: http://d711ds9nsj32q.cloudfront.net/static/8e1f8567e229e24e0782ed_1e994b9dc56ba092ecd2_5.jpg
A weird behavior is that if you try to sniff the headers with web-sniffer.net you'll see a MISS every single time. Even though the cache control is public, max-age=315360000 and it's set to expire after 10 years.
What is the proper way to cache something for 10 years on cloudfront? Are there any extra headers I'm missing?
Edit: For comparison here's the same image on imgur. They use cloudflare but the behavior I see there is correct. Once it caches, I never see a miss again from any of my computers or nearby locations. Both my headers and theirs are similar except for a few (unimportant) differences. Any help is appreciated.