我正在跟进google pagespeed的建议,以优化我们网站上的静态/图像。在我将grunt / imagemin与默认优化器(jpg的jpegtran)集成之后,我发现许多图像文件的平均优化率平均为20%,但google pagespeed建议的大图像文件已经发现已经优化了?
Reading project/apps/frontend/static/images.optimize/<...>.jpg...OK
Writing project/apps/setup/static/images/<...>.jpg...OK
✔ project/apps/frontend/static/images.optimize/<...>.jpg (already optimized)
Grunt config:
imagemin: {
dynamic: {
options: {
optimizationLevel: 3
},
files: [{
expand: true,
cwd: '<%= ... %>/static/images.optimize/',
src: [
'**/*.{png,jpg,gif}'
],
dest: '.../images/'
}]
}
},