title: Amazon cloudfront giving different assets for different user?
body: <p>I am having following folder structure in rails app.</p>
  
  <pre><code>|-assets
    |-javascript
      |-lib
          bootstrap.js
          jquery.js
      application.js
    |-styleesheet
       |-lib
         bootstrap.js
    application.js
  </code></pre>
  
  <p>the static assets are hosted in cloudfront by diffreent people I don't know how it was done.</p>
  
  <p>I have given the following config in production.rb.</p>
  
  <pre><code>config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
  config.assets.compile = true
  config.action_controller.asset_host = 'cloudfront url'
  </code></pre>
  
  <p>In view Page it will be like this:</p>
  
  <pre><code>&lt;%[application,lib/bootstrap].each do |css_url| %&gt;
     &lt;%= stylesheet_link_tag css_url%&gt;
  &lt;%end%&gt;
  
  &lt;%[application,lib/bootstrap,lib/jquery].each do |js_url| %&gt;
     &lt;%= javascript_include_tag js_url%&gt;
  &lt;%end%&gt;
  </code></pre>
  
  <p>When deployed in production and for the first request it will compile assets folder and store them in cache. for subsequent request it will take from cache.But every time I host and make first request cache generated for only some files, not for all the files.</p>