在不同主机上预编译具有相同摘要的资产 [英] Precompile assets with same digest on different hosts

查看:87
本文介绍了在不同主机上预编译具有相同摘要的资产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用相同的摘要编译不同主机上的资产(流量路由)?

Is it possible to compile assets on different hosts (traffic routing) with the same digest?

例如,如果将我的Rails 3.2应用程序部署到2个不同的主机host1和host2,则我希望在host1和host2上都具有相同的摘要application-34a9sadas1238023a8.css

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

推荐答案

每个摘要的摘要都是相同的,因为它基于文件的内容.

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.

这篇关于在不同主机上预编译具有相同摘要的资产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆