Cloudflare Worker scripts


I want to write Cloudflare worker scripts to modify response security headers.
[This use case might expand later].

I wanted to understand what is recommended approach
I know we can use:
1> Miniflare
2> Sunder
3> Hono
4> pure javascript

Wanted to understand which approach is recommended?

Miniflare is a local development/testing environment, not a Worker that runs on Cloudflare.

The rest is up to you, libraries might make it easier but if you’re just adding headers then you could likely just do that in Transform Rules and forego using a Worker.

It’d be extremely few lines to just add headers onto a response if you did want to stick with a Worker.


Hey @KianNH,

Thanks for the quick revert!

Later in Cloudflare I might add functionality, for rate limit in worker scripts.
Reason: I am in the Cloudflare Pro plan, rate limits only use proxy IP and not client IP, itself.
[This feature is added only in enterprise plan]

On Hono`s home page
It mentions Hono is much faster than Sunder, but there is no comparison against raw typescript?

I’m guessing we need the framework only for more complicated actions?
For my simple use case, any of the tools is good enough? :slight_smile:

my use case being : Header modify + (rate Limit using Proxy Ip + Client Ip)

What method do you feel will be apt ?

Appreciate the quick revert! :slight_smile:

1 Like