Scripting YSlow and/or PageSpeed

假如想象 提交于 2019-12-06 16:49:26

问题


As I'm starting to do some front end engineering at work, I would like to properly quantify the speedup achieved.

I would like to be able to use an average value of, say, 50 page load times measured by YSlow or Google Page Speed. Obviously, I don't want to hit reload 50 times and write down the value.

Is there a FF plugin for that or will I have to write a Firebug extension myself? Or maybe there is a non-FF, command-line tool that does what I'm planning?


回答1:


I recently did a talk about this at Google Test Automation Conference in Zurich for this.

Slides for it are here

And I did a blog post on my company site about it and that can be found here

We were able to use the YSlow Beacon and Selenium together to automate the entire process.

I hope that helps!




回答2:


Also check out GTmetrix which can do PageSpeed and YSlow analysis from a variety of reasons and has a free API you can use to automate this.




回答3:


Not sure if you use Grunt in your development workflow, but there is a great package avaible that allows for easy scripting - check it out:

https://www.npmjs.org/package/grunt-pagespeed

Once you run it, it will output the results as follows:

Or, if you prefer to write your own, the Google PageSpeed API is also quite easy to use. Check out this blog post for more information:

http://deanhume.com/home/blogpost/the-google-pagespeed-api-and-mvc-4/86



来源:https://stackoverflow.com/questions/1578315/scripting-yslow-and-or-pagespeed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!