Full Page Caching with Bunny CDN: Make you fast Ghost blog faster

Just wanted to share that we can easily do full page caching in Bunny CDN with ghost blogs.
I previously wrote about Increasing speed of ghost blog with cloudflare workers. But this bunny cdn method is much much easier.
Full page Caching dramatically reduce time to first byte, making you already fast self hosted ghost blog much faster. And also reduce load on your origin server. So you can serve large traffic with relatively cheap hosting.
You can do full page caching for logged out users. Member features works normally.
Has no problem with AdSense and even ezoic codes.
If you don’t want full page caching you can just do reverse proxy caching only static files.

No nginx modification needed.

Surprising discovery Bunny has much better routing than Cloudflare.

And the whole post is here:

3 Likes

Helpful article, thanks.

It could be improved by mentioning how to setup cached purging-- how to notify Bunny when Ghost content is updated or deleted.

That’s especially important if perma-caching is used, so the CDN will always assume that it’s cache is fresh:

Why use a perma-cache? For self-hosters, especially those hosting at home, this could smooth over downtime due to power outages or maintenance.

1 Like

Glad you liked it, I had actually created an automated way to purge cache. But posted on reddit Reddit - Dive into anything
Here is the reddit link to do that.
I didn’t updated the blog because I am working on techweirdo.net. and I will eventually merge those two.
Btw, at tech weirdo I am using ghost with bunny, but a side note, if you have login, members etc perma cache won’t work.
In My case, I am using 2 distributions. the techweirdo.net which only serves the html is served through the origin shield cache, as it does that dynamic full page caching based on cookies. And I serve all the static assets like images, css , js through cdn.techweirdo.net which uses perma cache. And I do the url rewrite using nginx subfilters. When something changes like, posts etc. You don’t need to purge the static assets. Only create the automation to purge the html distribution.
I know I made it complex, but it is kinda the best of both worlds.
Also I did a load testing on the site, it managed 17000 synthetic page view in 3 minutes (load testing servers got overloaded).

2 Likes


And this is my absolutely unnecessarily overcomplex ghost blog setup :smiling_face_with_tear:

2 Likes

It makes sense to me.

1 Like