为什么pagespeed模块要添加eval()?
Why does pagespeed module add eval()?
我通过我的 cPanel 在我的网站上激活了 Google PageSpeed 模块,我的网站现在似乎快了很多,但我注意到它增加了很多:
<script>eval(mod_pagespeed_123ABC);</script>
<script>eval(mod_pagespeed_456DEF);</script>
等..
有谁知道为什么他们需要在那里以及是否有办法删除它们?
这是“合并 JavaScript”(combine_javascript
) 设置。
https://developers.google.com/speed/pagespeed/module/filter-js-combine#configuration
'Combine JavaScript' seeks to reduce the number of HTTP requests made by a browser during page refresh by replacing multiple distinct JavaScript files with a single one.
This filter employs the Javascript 'eval' expression to evaluate each tag at its proper location in the DOM, but getting the aggregated script content in one HTTP fetch. The effects of this are likely to differ between browsers, and haven't yet been thoroughly measured.
我通过我的 cPanel 在我的网站上激活了 Google PageSpeed 模块,我的网站现在似乎快了很多,但我注意到它增加了很多:
<script>eval(mod_pagespeed_123ABC);</script>
<script>eval(mod_pagespeed_456DEF);</script>
等..
有谁知道为什么他们需要在那里以及是否有办法删除它们?
这是“合并 JavaScript”(combine_javascript
) 设置。
https://developers.google.com/speed/pagespeed/module/filter-js-combine#configuration
'Combine JavaScript' seeks to reduce the number of HTTP requests made by a browser during page refresh by replacing multiple distinct JavaScript files with a single one.
This filter employs the Javascript 'eval' expression to evaluate each tag at its proper location in the DOM, but getting the aggregated script content in one HTTP fetch. The effects of this are likely to differ between browsers, and haven't yet been thoroughly measured.