Caching full content on Cloudflare

Yesteray I went off on an experiment with one of our own Drupal sites.  For some years now I've maintaned the web site - it's a political blog about progressive politics in Wisconsin.  It's gone thorugh a lot of different configurations and life stages. At the moment it's built on a pretty straightforward build of Panopoly,.  In the most recent version I have taken it out of Varnish, and it runs behind Cloudflare.

In an attempt to eat our own Dogfood as a Cloudlflare host, I though I'd make a stab at making Cloudflare cache the entire site, rather than just the static assets. You can do this in the free Cloudflare implementation by setting up a rule that says "cache everything" and putting it in with your three allowed rules. I've also set up rules to not cache admin* and user* and have put those ahead of the cache everything rule - so that admin functions are not cached.

It took a couple of cache clears everywhere to get this to behave, but it seems to be working fine.

Since this is a blog and it has frequent updates (well, at least when I'm not buried in work) it wasn't sufficient to just let Cloudflare cache things for a long time - we want to see things update when new content is put in.

So I've combined this with the Cloudflare Purge module. This module uses the Cloudflare API and the Cache Expiration module to expire items from the Cloudflare cache when they change.

So far this is looking really promising, and has had significant effects on the snappiness of the site.  We've not explored this very thoroughly, so you can probably expect a follow-up article in a few weeks.