为什么Google使用内联JavaScript和CSS? [英] Why does Google use inline JavaScript and CSS?
问题描述
在查看Google网页的源代码时,我只能看到内嵌的CSS和JS。我没有看到任何CSS文件或JS文件被包括。
I can only see inline CSS and JS while viewing the source code of Google webpage. I don't see any CSS file or JS file being included.
他们如何包含jquery,插件等? (或)Google是否使用Jquery?
How do they include jquery, plugins etc? (or) Does Google use Jquery?
推荐答案
Google 使用 Closure Compiler 压缩其JavaScript。
否,Google肯定不使用jQuery - 它是所有的vanilla JavaScript和(有时) Closure库。
Google uses Closure Compiler to compress its JavaScript.
No, Google certainly does not use jQuery—it is all vanilla JavaScript and (sometimes) Closure Library.
对于内联,如果JS / CSS相对较小,则更快地内联以最小化HTTP请求数。
As for inlining, if JS/CSS is relatively small, it is faster to inline it to minimize the number of HTTP requests.
Google Page Speed Online 可为您提供一些有关如何优化您的网页。
Apache的mod_pagespeed 可以进行许多优化为您(包括在适当的内容内容)。
Google Page Speed Online can give you some tips on how to optimize your page.
mod_pagespeed for Apache can do many optimizations for you (including content inlining where appropriate).
这篇关于为什么Google使用内联JavaScript和CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!