I'm not sure what the asset pipeline means, so I'll leave it to you.
In the first place, the web browser displays the screen by reading `HTML, CSS, JavaScpirt, WebAssembly```. (WebAssembly is a new type of code that significantly improves performance) The mechanism that allows the browser to read
`HTML, CSS, JavaScpirt, WebAssembly``` is called asset purpline.
An asset pipeline is a framework for minimizing or compressing and concatenating JavaScript and CSS assets (such as minify: padding spaces and line breaks).
Your own summary A function that combines static files such as CSS and Javascript that are arranged so that humans can easily see them. Why put together → To reduce the number of requests to files and reduce processing.
--In the development environment, there is nothing special to do because the mechanism that goes through the asset pipeline is automated.
--In a production environment, you need to do it manually.
rails assets: precompile RAILS_ENV = production
command) config.assets.compile = false
in config / environments / production.rb
Change false to trueWhy set config.assets.compile = false
to true?
What is config.assets.compile
in the first place?
Apparently config.assets.compile
Find and compile files when they don't exist
It seems that you can do it. (Rails document quote)
Description If "true", when the required file is not found in public / assets, the file is searched from app / assets etc. and compiled.
It seems convenient, but if you set it to true, it will put a load on the server ... Is it okay to set it to true and put a burden on using the mechanism of the asset pipeline to increase the processing speed? Once you come up with it, it won't stop!
So far, I have described what I have learned about the asset pipeline. I haven't understood the details yet, so I will study!
https://railsdoc.com/page/config_assets_compile https://developer.mozilla.org/ja/docs/WebAssembly/Concepts https://www.transnet.ne.jp/2016/02/28/rails%E5%88%9D%E5%AD%A6%E8%80%85%E3%81%8C%E3%81%A4%E3%81%BE%E3%81%9A%E3%81%8Dcolnr%E3%80%8C%E3%82%A2%E3%82%BB%E3%83%83%E3%83%88%E3%83%91%E3%82%A4%E3%83%97%E3%83%A9%E3%82%A4%E3%83%B3/
Recommended Posts