Ghost with custom CDN is possible?

I wonder if we can continue using Bunny CDN (A+ service for and ultra affordable price, I’m not doing promotion but I’m user from 3 years ago).

It’s all OK with Cloudflare but we think that we can avoid to keep centralized our data or management and save 19,50 bucks per month.

So, what’s the level of difficulty and what we need to link Bunny with Ghost? :slight_smile:

Thanks,
M.

I came across an article that may help point you in the right direction for getting setup:

3 Likes

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 :slight_smile:

2 Likes

Do you perhaps have any instructions on how you achieved this? Did you have any issues since>?

You can publish your site to subdomain.yoursite.com (and yoursite.com) so you can use subdomain.yoursite.com as origin on CDN cache server.

They will give you a new address that you can CNAME to cdn.yoursite.com.

So at the end you get yourdomain.com like always and cdn.yoursite.com cached (that pulls data from subdomain.yoursite.com).

Remember to add some rules to not caching member, admin and api routes. Google has more info if you look for ghost+cdn.

It’s a little tricky but it works and that’s what I’m doing at the moment.

You will need to edit your own configuration like Apache, Nginx or something.

I suggest to contact a server administrator if you don’t know what we are talking about (security is top important).

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?

storage: {
active: ‘bunny’,
bunny: {
cdnUrl: ‘https://example.b-cdn.net’,
storageUrl: ‘https://storage.bunnycdn.com’,
accessKey: ‘your_access_key’,
storageZone: ‘your_storage_zone_name’
}
}

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).

Thanks. I see it supports S3 supported in this way so I was hoping bunny would be as well

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 :slight_smile:

If Bunny is s3-compatible, I assume you would need to set the active storage adapter to whichever s3 storage adapter you’re using

It’s not S3 compatible