title: Cloudfront file names
body: <p>I am learning AWS and Cloudfront (CF) on the job in a startup. Most of the learning is not very systematic (not in depth) due to time constraints. One question I just can't find a solution for. My CF distribution is linked to an S3 bucket where all assets (CSS, JS files, etc) are. The filenames in the bucket look like this:</p>
  
  <p><a href="https://i.stack.imgur.com/y9BxV.png" rel="nofollow"><img src="https://i.stack.imgur.com/y9BxV.png" alt="assets in s3"></a></p>
  
  <p>We covered CDNs at university at some point, and I remember that they calculate hashes of files and use those hashes to "find" the location (IP) of the server (in the distribution, similar to name resolution in DNS) where that file is to serve it. Maybe I misunderstood that part?</p>
  
  <p>Hence the questions: </p>
  
  <ul>
  <li>what is that alphanumeric sequence in the names served by CF? Is that a hash?</li>
  <li>who calculates that value: CF, S3 or deployment process?</li>
  <li>why is that value different sometimes and results in 404 errors on the server?</li>
  </ul>
  
  <p>Also, it is worth noting that at some point the deployment was done using <code>capistrano</code> (yep, it's Rails), which used <code>asset_sync</code> gem to push assets to S3. However, on the new production we are not using that - just version control on all assets.</p>