A History of HTML Parsing at Cloudflare: Part 1
Nov 28, 2019Andrew Galloni, Ingvar Stepanyan

Summary
This post details the evolution of HTML parsing and rewriting at Cloudflare, starting with ad-hoc parsers for email obfuscation and minification, and progressing to a spec-compliant HTML parser (lazyhtml) and a streaming HTML rewriter (lol-html) for Cloudflare Workers. It highlights the technical challenges of low-latency, high-throughput, and memory-constrained parsing at the edge, contrasting it with browser-based parsing. The post introduces the concept of streaming HTML rewriters and their application in solving problems like mixed content.