Hey! Cool that you linked it, I’m still using that set-up although I would like to point out a couple downsides:
Not sure how well it works with Ghost Members.
It can break post previews in the editor (when you click to see the post rendered on the blog itself) Though it might be possible to set up an edge rule to avoid caching those as well.
Bunny aggressively tries to avoid updating their cache, which should be fairly obvious since it’s a CDN but still worth keeping in mind. When updating posts etc. you usually have to purge the relevant pages manually using their panel. It’s instant and not really difficult to do.
In any case, I’m still a happy customer of theirs and use it pretty extensively (outside of just having Ghost behind it). Also happy to answer questions if something is unclear
In Wordpress i usually offload images to store directly to bunnystorage for uploads and pull from bunny cdn for downloads. Trying to accomplish this with Ghost. Read the config documentation and came up with this to add in the config. But its not working. Can you tell whats wrong?
Ghost don’t support Bunny that way, you need to do some workaround or develop that variables on the code (offering a PR on main branch or forking your own instance).
I don’t think Ghost team will cover that because they have their own comercial agreements or just proximity with another parties (Fastly at this case).
If you want to use Bunny you need a server manager or manage it by yourself
I integrated Bunny CDN by re-writing the image URL’s with nginx, it does does not break the backend /ghost - and Ghost can be edited on the non-cached origin URL. normal site URL
I eventually got an adapter script written using the ghost docs. I’ve implemented it on a few sites and works well, I think that’s the best solution. Ghost uses a bunny storage zone to offload media, and uses a pull zone(CDN) to pull the images.
That’s a great idea. If I could recoup some cost of dev for it. Bunny is the best solution for offloading I’ve found. Costwise it’s pennies and you can add image optimisation on the pull zone and serve multiple sites at just $10. I use it with Wordpress clients as well for years, very good service. Can I get back to you on this?
I have followed @skyeto’s blog post to set up BunnyCDN with a Ghost site and the actual caching worked out of the box. What didn’t work was accessing the /ghost route to edit the site and logging in to the portal as a member.
My assumption is that BunnyCDN has changed since June 2021/2022, so here’s what ended up working for me, in case anyone stumbles upon this thread in the future (just adding differences to the original post):
Edge Rules
To successfully bypass all API requests (relevant for the admin panel to work properly) you need to set “Cache Time” and “Browser Cache Time” to 0 for the following routes:
*/ghost*
*/members*
Caching settings that need adjustment
In the “General” caching settings:
“Query String Sort” needs to be off. This is necessary for the members login to the portal to work
“Strip Response Cookies” also needs to be off. Otherwise you won’t be able to log into the /ghost route, meaning you can’t edit your site.
Hope this helps
Edit: just put the findings into a blog post to go into a bit more details: