Ich bin relativ neu in RoR und ich bin neugierig, warum Rails Assets mit und ohne MD5-Hash für die Produktion kompiliert?Rails kompiliert Assets sowohl mit als auch ohne MD5-Hash, warum?
Ich betreiben bundle exec rake assets:clean
dann bundle exec rake assets:precompile
Meine production.rb Datei:
MyApp::Application.configure do
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Disable Rails's static asset server (Apache or nginx will already do this)
config.serve_static_assets = false
# Compress JavaScripts and CSS
config.assets.compress = true
# Don't fallback to assets pipeline if a precompiled asset is missed
config.assets.compile = false
# Generate digests for assets URLs
config.assets.digest = true
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
config.assets.precompile += %w(tos.js, tos.css)
config.i18n.fallbacks = true
config.active_support.deprecation = :notify
end
Meine Anwendung arbeitet mit Dateien mit Hashes in ihrem Namen und es ist so, wie es in meinem Fall sein sollte :)
So habe ich zwei Fragen hier:
1) Warum passiert es, wenn kompiliert?
Rails kompiliert Vermögen sowohl mit als auch ohne MD5-Hash für die Produktion
2) Was sind diese Dateien (ohne Hashes) für?
Vielleicht bekomme ich nichts, also bitte könnte jemand erklären.
Hallo Chris Vielen Dank für Ihre Antwort und Erklärung, ich dachte, dass ich eine Fehlkonfiguration habe, die dieses Verhalten verursacht. Wenn es so ist, wie es sein sollte, dann ist es ok für mich. Danke noch einmal. –
Auf der anderen Seite der Dinge, meine Rails-Installation hat die gleiche Konfiguration wie seine, aber es ist nur kompiliert Vermögenswerte mit dem Fingerabdruck, und kompiliert die Versionen ohne den Fingerabdruck. Dies ist sehr ärgerlich für die von Chris Bailey aufgeführten Gründe. Irgendeine Idee, wie ich das beheben kann? – NudeCanalTroll
@NudeCanalTroll: Sie führen keine 'Rake-Assets: Vorkompilierung: Nicht-Digest'. – jpatokal