CMS PageSpeed Optimization Integration
Web performance vs Content Management Systems
Content management systems are not known for their efficiency from a web performance perspective - especially the slightly older ones. From the vendor's perspective, it makes sense to build a very generic one-size-fits all solution to cater the needs of a broad range of customers.
A downside of the one-size-fits-all approach is that the html, scripts, images, and css that are generated by such systems are often far from being lean and mean. For example, some systems will forward any image that you might upload for display in a page without optimizing it for the web first.
In both examples, the users of the CMS systems cannot be blamed for the degraded user experience on the website.
PageSpeed to the rescue
Controlling pagespeed optimizations from the CMS
Here is a lightweight way to integrate pagespeed into your CMS: you can control which optimizations pagespeed will apply from script, by sending out a response header named "PageSpeedFilters".
The trick is to let the CMS generate that header and put a value into it when a user has specified that for a page.
This is particularly useful after the initial tuning phase, in case a CMS user needs to enable or disable filters for one or more pages.
Approaching an integration - carefully
At We-Amp, we recently added page speed optimization into the mix for an agency that run lots of (e-commerce) websites through a content management system.
Steps taken in our approach:
- Install the PageSpeed module for the relevant server technology, IIS in our case.
- Set the base optimization level of the pagespeed module to 'PassThrough', which means only html will be parsed and reserialized. Let this run for a while, letting a significant amount of live traffic pass by. In this phase, keep an eye on conversion rates and event logs.
- If all is OK, it is time to flip the switch and set the optimization level to something a little more aggressive:
optimizing for bandwith. This optimization level is designed to be as safe as possible, so pagespeed will be very conservative in it's rewriting.
- Monitor the server load, conversion rates, and pagespeed statistics for a while to make sure all is well. If the server is spiking, it should usually settle down quickly as pagespeed learns how to best optimize the website. If you are tight on cpu, you can throttle by:
- Limiting the number of concurrent image optimizations
- Randomly dropping optimizing rewrites (eventually everything will be optimized anyway)
To figure out which optimizations make the most sense to enable, test your Page Speed with PageSpeed Insights is a very good place to start. It will give you suggestions on what optimizations would be good to enable in the pagespeed module, and help you comply to best practices.