Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Probably not without some work. I think you have to get the PageSpeed Optimization Library and build it from source, as described here: https://github.com/pagespeed/ngx_pagespeed/wiki/Building-PSO...

(hi!)



Hmmm. I don't really know C++ well enough to do this myself. Oh well.

Seems like it would be super useful to have a command line version of this so I could take an html file, pipe it in and get out an optimized file, and then diff them so I can learn to make my pages better.

I suppose as a hack I could set up nginx with the plugin and then load each page through curl or something and diff them that way...


That wouldn't be a 100% match since it assumes HTTP headers and mangles them, too. For example, it probably uses the MIME type served by the proxied server to see whether it's css or js or whatever should be minified (I didn't check the sources for this).

With a pipe, it'd need to use heuristics to figure out what kind of file it is. That could be added, probably, but it's not entirely trivial.

Additionally, you'd miss out on all the HTTP header mangling, such as cache expiry settings.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: