[英]How can i defer javascript files not in use in my rails app to make the app run faster
It gave me a suggestion that leads to my question. 它给了我一个建议,导致了我的疑问。 Here was the suggestion
这是建议
181.6KiB of JavaScript is parsed during initial page load. 在初始页面加载期间会解析181.6KiB的JavaScript。 Defer parsing JavaScript to reduce blocking of page rendering.
延迟解析JavaScript以减少页面呈现的阻塞。
Other problems were that my css,js and html seem not to be minified my files were kept in the assets directory.. 其他问题是我的css,js和html似乎没有缩小,我的文件保存在资产目录中。
Don't worry about the JS stuff. 不用担心JS的东西。 If you run a pagespeed on
google.com
it will say that too (as a low priority). 如果您在
google.com
上运行Pagespeed,它也会说(低优先级)。 Not everything pagespeed tells you is meant to be done. 并非pagespeed告诉您的一切都是注定要完成的。 Even if you did defer your JS, a lot of stuff might break due to it needing to run on page load.
即使您推迟了JS,由于需要在页面加载时运行,很多内容也可能会中断。
Now for the css, js, and html, it is most likely not minified because you are running in development mode (which disables that). 现在,对于css,js和html,由于您正在开发模式下运行(禁用了该模式),因此很有可能没有缩小代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.