资产管道是否符合 3.1 废物循环?
在 Rails 3.1 中,.coffee 和 //= require 文件仅处理一次或与每个资产一起处理 要求?
例如,我有一个文件
//= require source/main.js.coffee
//= require source/second.js.coffee
//= require source/third.js.coffee
理想情况下,服务器会将它们编译为 js ONCE,然后捆绑它们,然后 创建一个静态文件。但如果它发生在每个资产请求上,就会浪费周期重复它?
感谢您对此的任何指导。
In rails 3.1, does .coffee and //= require files get processed only once or with each asset
request?
For example,I have a file
//= require source/main.js.coffee
//= require source/second.js.coffee
//= require source/third.js.coffee
Ideally, the server would compile these to js ONCE, then bundle them, then
create a static file. But if it happens on each asset requests,it's going to be wasting cycles repeating it??
Thanks for any guidance on this.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,资源将被编译并缓存。因此它们不会产生额外的周期。您还可以在将它们投入生产之前对其进行预编译。
这是一篇很好的文章: http://blog.nodeta.com/2011/06/14/rails-3-1-asset-pipeline-in-the-real-world/
Yes, the assets will be compiled AND cached. So they won't generate additional cycles. You can also pre-compile them before you push them to production.
Here is a good writeup: http://blog.nodeta.com/2011/06/14/rails-3-1-asset-pipeline-in-the-real-world/