Q: Rails 5 assets not loading consistently in Production I have a = javascript_include_tag "subfolder/Js_File" at the end of the page in a view (HAML).
I have the following line in manifest application.js
//= link_directory ./subfolder
When I clear the browser cache and load the application for the first time. My assets are not loading (No CSS and JS). When I do a CTRL+R or Command+R. The page loads with CSS and JS.
But still the JS in "subfolder/Js_File" is not loaded. When I navigate out from this page and later navigate back to the page my "subfolder/Js_File" file loads and works as expected.
My production.rb has the following lines for assets
  config.public_file_server.enabled = true # tried changing this to false
  config.assets.compile = true # tried changing this to false
  config.assets.digest = true
  config.assets.version = '1.0'


A: The above configuration is correct. There was a problem with the remotely hosted asset server, it is load balanced. On one of the node the assets were not getting copied. Infrastructure had to be fixed.
