问题
Is it possible to compile assets on different hosts (traffic routing) with the same digest?
For example, if my Rails 3.2 app is deployed to 2 different hosts host1 and host2, I want to have application.css
on both host1 and host2 with the same digest application-34a9sadas1238023a8.css
回答1:
The digest is going to be the same for each host because it is based on the content of the file.
If you are deploying to multiple hosts, the assets will get precompiled on both during deployment.
If you want to avoid this because of the time it takes, there is a way to compile locally and commit, and still have development mode work as expected. It is here.
来源:https://stackoverflow.com/questions/10692348/precompile-assets-with-same-digest-on-different-hosts