← Back to context

Comment by andersmurphy

7 months ago

So I actually do this (use compression to filter out bots) for my one million checkboxes Datastar demo[1]. It relies heavily on streaming the whole user view on every interaction. With brotli over SSE you can easily hit 200:1 compression ratios[2]. The problem is a malicious actor could request the stream uncompressed. As brotli is supported by 98% of browsers I don't push data to clients that don't support brotli compression. I've also found a lot of scrapers and bots don't support it so it works quite well.

[1] checkboxes demo https://checkboxes.andersmurphy.com

[2] article on brotli SSE https://andersmurphy.com/2025/04/15/why-you-should-use-brotl...