2. What Is Mod_Pagespeed?
“mod_pagespeed is an open-source
Apache module created by Google to help
Make the Web Faster by rewriting web
pages to reduce latency and bandwidth”
http://www.modpagespeed.com/
3. What it Does
“Performance JIT” to automate 40+ performance best
practices:
Complexity
Content Compression
Spriting
Defer Javascript
Lazy Loading
Image Optimization
Caching Combine CSS
Combine JS
Inline CSS
Minifiy Text
CSS to Head
Conditional WebP
Full List
4. “Filters”
• “Core Set” of “safe” optimizations
– Combine CSS, Compress Images, Minify, etc.
– Turns on mod_deflate (Gzip compression)
• Optional filters for potentially disruptive improvements:
– Move CSS to head
– Convert PNG to JPG
– Remove HTML comments
– Sprite Images
• https://developers.google.com/speed/pagespeed/modul
e/config_filters
5. How it Works
• Great (long) youtube video
– Skip to ~22 minute mark for Apache filters
• Apache input & output filters to rewrite content
• Based on pagespeed libraries (not Apache specific)
• CPU intensive operations offloaded to background
– Optimize on first use
– Examples: image compression, resize images
8. Advanced Features
• Per-request testing
http://yoursite.com/file.html?ModPagespeed=on&Mod
PagespeedFilters=rewrite_css
• A/B testing w/ Google Analytics
Use different filters for different % of traffic, different
event IDs
• Mapping sharded domains to mod_pagespeed