ats_pagespeed: Automatic WPO plugin powered by Google PageSpeed Optimization

ats_pagespeed provides automatic web performance optimization,  powered by Google PageSpeed.
The plugin was build by We-Amp for its online demonstration service  of PageSpeed optimization for Microsoft IIS: IISpeed.
Google PageSpeed Optimization speeds up your website by implementing web performance best practices.  
A few of its features:

 

  • Prioritize visible content above the fold
  • Minify, rewrite, and combine javascript
  • Optimize images (inlining, rescaling/recompression, webp transcoding and more)
  • Sprite css images
  • HTML minification
  • Defer javascript
  • Lazyload and inline images
  • A complete list of features resides here

Ats_speed is licensed under the Apache License, Version 2.0, and resides on github.
We are able to offer official support and tuning at info@we-amp.com.

Our intent is to donate the port to the ASF and if possible merge with LinkedIn's work on ats_pagespeed
Another improvement would be to migrate it to LinkedIn's C++ API's, as that would improve things
from a maintenance perspective. 
 

Techical details

The current state compiles against mod_pagspeed svn revision 3537.

Please note the this plugin will generate asserts when build against the debug version of mps (option->Merge from a different thread).

The plugin should be considered a work-in-progress. Currently it perfectly fits our first use case, but to be able to use this 
as a generic addition for a CDN or accelerator, some things need to be improved. 
That primarily concerns configuration, and possible the introduction of multiple ServerContext's to be able to
balance resources for multiple hosts properly. 

There's also a few nice opportunities:

  • Create native statistics for the port by re-using ATS's statistics capabillities
  • Create a native async cache by integrating tightly with ATS's wonderful caching infrastructure
  • Create a native async fetcher by wrapping ATS's fetching capabilities. This would probably be a real big win
    and also make this the first port which supports keepalive for fetching content. 

This plugin is known to be working on ubuntu 12.x (x64)

There are some hard-coded things in the plugin, so it expects:

  • /tmp/ps_log/ to exist
  • /tmp/ats_ps/ to exist

Configuration files go into /usr/local/etc/trafficserver/psol. That folder is monitored, and changes to files in there are picked up immediately.
A sample configuration (/usr/local/etc/trafficserver/psol/foo.config):

# [host] [192.168.185.185] 
# Force traffic server to cache all origin responses 
override_expiry pagespeed 
FlushHtml on 
pagespeed RewriteLevel CoreFilters 
pagespeed EnableFilters rewrite_domains,trim_urls pagespeed 
MapRewriteDomain http://192.168.185.185 http://www.foo.com 
pagespeed MapOriginDomain http://192.168.185.185 http://www.foo.com 
pagespeed EnableFilters prioritize_critical_css,move_css_to_head,move_css_above_scripts 
pagespeed EnableFilters fallback_rewrite_css_urls,insert_img_dimensions,lazyload_images,local_storage_cache 
pagespeed EnableFilters prioritize_critical_css,rewrite_css pagespeed EnableFilters combine_javascript,combine_css

The plugin also expects this in records.config from ATS to function:CONFIG proxy.config.url_remap.pristine_host_hdr INT 0
You can view debug output of the plugin using traffic_server -T ".*speed.*"

 

 

 

  • No labels