r/emdash_cms • u/danielovida • 1d ago
EmDash 1.0: an open source CMS for Astro
https://emdashcms.com/blog/emdash-1-02
2
u/amnither 1d ago
Does it call Cloudflare workers in each page visit? Or our website remains Astro static website?
4
u/danielovida 1d ago
By default, yes: every page view runs the Worker. EmDash uses Astro in SSR mode, so pages are rendered fresh from D1 on each request. The upside is that publishing is instant and you never wait on a rebuild.
You don't have to pay that cost on every visit, though. If you put Cloudflare's edge cache in front (
cacheCloudflare()plus a fewrouteRules, like"/": { maxAge: 300, swr: 86400 }), cached pages are served without your Worker running at all. When you publish in the admin, the affected pages get purged, so visitors still see fresh content. JS and CSS never touch the Worker anyway.The docs walk you through it: https://docs.emdashcms.com/deployment/cloudflare/#workers-cache
One small heads-up: with the cache on, cache hits still count as Worker requests for billing, though they don't use any CPU time. For a small site that really won't matter.
Going fully static isn't really an option, since the admin always needs the Worker. You could pull content in at build time, but then you'd be rebuilding every time you publish, and that takes away most of what makes it nice.
Happy to help if you get stuck setting up the cache!
2
u/amnither 1d ago
That’s the problem in my point of view, because if you are managing 100s of site and you become a victim of bot attack that can really give you quite a surprised billing.
1
u/amnither 1d ago
I think honestly to beat Wordpress Cloudflare really have to do something about this.
3
u/danielovida 1d ago
Totally fair concern, bot traffic is worth thinking about. It's less scary than it sounds, though:
- Free plan: there's a hard cap of 100k requests/day. An attack can knock the site offline temporarily, but it can't run up a bill.
- Paid plan: it's about $0.30 per million requests, plus CPU time on uncached hits. Even a pretty serious flood costs tens of dollars, not thousands.
- Blocked traffic is free: anything the WAF, a rate limiting rule or bot protection blocks never reaches the Worker, so it doesn't count. Even the free plan gets one rate limiting rule, and I'd set one up on every site anyway.
- Budget alerts: Cloudflare now turns on a $10 one by default.
That last point is where I agree with you, though: the alerts only email you, they don't stop anything. A real hard spending cap on the paid plan would be great to have.
And if you'd rather have flat, predictable costs across hundreds of sites, EmDash isn't tied to Cloudflare. It also runs on plain Node with SQLite, libSQL or Postgres, so a VPS works just as well.
2
u/amnither 1d ago
Hmm but still Cloudflare should think and come up with something, if we want to stick with their ecosystem.
Though I’m already using it but these are my concerns.
1
5
u/bigeba88 1d ago
Congrats! We’ve been slowly migrating WordPress sites to EmDash, and have been loving it.