mod_pagespeed自动执行但可能被跳过的操作的一个示例是: 1.合并和缩小JS和CSS (例如,可以使用Browserify之类的工具来完成) 2.压缩图像3.异步加载/注入JS和CSS (脚本加载器、原子化等) 4.用于缓存破坏的静态资产版本控制(grunt-usemin等)
举个例子,现在我已经移除了静态资产版本化,取而代之的是我们的global.js和global.css文件没有版本化,而且到期时间很短。这是因为无论如何,mod_pagespeed很快就会将其版本化为巨大的过期。
发布于 2014-09-10 21:47:25
我们为一家大型电信公司的主门户网站实现了mod_pagespeed。虽然PageSpeed是一个非常方便的优化工具,但它不是魔术棒,并且有一些严格的限制。我们抛弃了大多数传统的技术,但发现需要大量的手动修复资源才能使一切得到优化。
- You cannot combine JavaScript across inline scripts and IE conditional comments.
- You cannot combine JavaScript files that employ "use strict" (you might need a filter to strip these out at runtime)
- Further limitations at [https://developers.google.com/speed/pagespeed/module/filter-css-combine](https://developers.google.com/speed/pagespeed/module/filter-css-combine) and [https://developers.google.com/speed/pagespeed/module/filter-js-combine](https://developers.google.com/speed/pagespeed/module/filter-js-combine)
- mod\_pagespeed must be able to fetch and rewrite your resources (if this is not configured correctly, nothing will happen)
不支持
<script pagespeed_no_defer="">...</script>的机制另外,懒惰加载图片真的很有效well.
用于缓存破坏的
此外,如果您正在考虑使用图像spriting,请注意它有非常严格的限制:Image spriting with mod_pagespeed
https://stackoverflow.com/questions/24743710
复制相似问题