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.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With