ruby on rails - File digest/fingerprint is not always included in asset files -
i precompile assets , use following function render html:
= stylesheet_link_tag "frontend/application", media: "all", "data-turbolinks-track" => true = javascript_include_tag "frontend/application", "data-turbolinks-track" => true
sometimes methods generat correct html:
<link data-turbolinks-track="true" href="/assets/frontend/application-64cf06dd4d2386f145e00844fed60d28.css" media="all" rel="stylesheet" /> <script data-turbolinks-track="true" src="/assets/frontend/application-447281961c979f73e944369c4b832fd8.js"></script>
but on production rails (50%!) generates assets html this
<link data-turbolinks-track="true" href="/stylesheets/frontend/application.css" media="all" rel="stylesheet" /> <script data-turbolinks-track="true" src="/javascripts/frontend/application.js"></script>
i use heroku on production. idea wrong or how can fix this?
below production settings.
# disable rails's static asset server (apache or nginx this). config.serve_static_assets = true # debug mode disables concatenation , preprocessing of assets. # option may cause significant delays in view rendering large # number of complex assets. config.assets.debug = true # compress javascripts , css. config.assets.js_compressor = :uglifier config.assets.css_compressor = :sass # not fallback assets pipeline if precompiled asset missed. config.assets.compile = false # generate digests assets urls. config.assets.digest = true # version of assets, change if want expire assets. config.assets.version = '2' # specifies header server uses sending files. # config.action_dispatch.x_sendfile_header = "x-sendfile" # apache # config.action_dispatch.x_sendfile_header = 'x-accel-redirect' # nginx
here preview of problem: view-source:http://v5.megabon.com/en
the way work on heroku set compile false
config.assets.compile = false
and delete every precompiled file in public folder. forces heroku recompile assets on every git push.
Comments
Post a Comment