[Performance] Incorporate Varnish Cache + Mod PageSpeed

Not sure if it fits in with the OSA initiatives but as you already know parts of your stack are not only useful for data privacy but also very valuable as a hedge against hosting (vendor) lock-in with companies like Pantheon.io.

So here are two ideas to make the WordPress sites faster potentially with little additional work:

Include a Vanish Cache to speed up performance of the site for "anon" (not logged-in) users. The varnish cache sits behind the Ingress and in front of the application pods. It serves up static HTML content and can be used in combination with a WP caching plug-in such as W3TC to pre-generate page HTML.

Benefits:

  • Reduce number of Apache threads spawned
  • Reduce time in PHP doing PHP things
  • Further decrease potential hits against the DB
  • Augment Redis by limiting potential DB lookups

Per my understanding if the site is going to be served from a CDN the CDN will need cached page HTML in order to be useful. Also, Apache instance spawning can consume quite a bit of memory during periods of high traffic which could potentially topple an otherwise healthy cluster.

Links:


Another potential performance enhancement is to add mod_pagespeed which I previously thought only worked with Nginx but apparently works with Apache as well. Mod PageSpeed allows users to optimize pages by doing useful things like combining scripts and CSS and limiting their size to chunks which result in a faster mobile page loads due to packet size limitations/etc.

Link: https://www.modpagespeed.com

Edited by balibebas