Вопрос

I am trying to automate web page performance using pagespeed.

Is there any plugin available for pagespeed to run on phantomjs

we have yslow plugin for the same and its working locally

http://yslow.org/phantomjs/

I am using the command line and then integrating the same with Jenkins for continous integration

thanks and appreciate your help

some sample code

 phantom.create (ph) ->
      ph.createPage (page) ->
        page.open "http://www.google.com", (status) ->
          console.log "opened google? ", status
          page.evaluate (-> document.title), (result) ->
            console.log 'Page title is ' + result
            ph.exit()
Это было полезно?

Решение

Since PageSpeed is a C++ binary, you might want to try integrating PhantomJS netsniff.coffee (from the examples) that generates a HAR file of a given page piping the output into HAR_to_PageSpeed. Or just go with PageSpeed Insights online service.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top