Why are ALL files included in Rails' asset pipeline?

丶灬走出姿态 提交于 2019-12-12 20:06:39

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!