A Better Cache Invalidation Solution for Ghost

I just worked on some infrastructure stuff at Magic Pages and realised that I never properly shared about one of my favourite little details the Ghost team implemented a long, long time ago.

It’s not documented anywhere, so technically it could change at any point (please don’t :grimacing:), but it is, in my eyes, the best way to deal with cache invalidation when you use a CDN in front of your Ghost site: the X-Cache-Invalidate header:

8 Likes

Quick addition though:

@muratcorlu pointed out on Reddit that there is the site.changed webhook event. So, the statement in the blog post that webhooks cannot invalidate the cache on all changes is simply wrong. No idea how I missed that, but thanks for pointing it out, Murat :smiley:

3 Likes