Introducing the HTMLRewriter API Beta to Cloudflare Workers
blog.cloudflare.com
blog.cloudflare.com
> Not only does this use (much) less overall CPU and RAM, but it avoids delaying TTFB. Also elements you want to modify are selected using CSS selector syntax which makes things nice and easy. It may seem like a small thing to some but I'm pretty excited about this.
Previously I was doing things like fetching content, running some regex replaces, and then returning the changed content. Being able to do this dynamically and in real-time without delaying TTFB is incredible.