问题
Why are ALL JavaScript and CSS files included in the asset pipeline rather than the ones that are actually being used?
For example, if I have a simple website with a home page and blog, why are the home page's JavaScript and CSS files included when a user is viewing the blog? Or vice versa, why are the blog's assets included when viewing the home page?
回答1:
They all get compiled together and minified so the footprint is really small.
Also once they are loaded once, they are cached so the rest of the page views are faster.
来源:https://stackoverflow.com/questions/17137057/why-are-all-files-included-in-rails-asset-pipeline