logoalt Hacker News

robin_reala • today at 7:50 AM • 2 replies • view on HN

Those class names surely gzip better than hashes over the wire?


Replies

efortis • today at 8:08 AM

Here's a comparison using `brotli --best` on my app.

   53K _long.css
   38K _short.css

   11K _long.css.br
  8.9K _short.css.br
Both, dev and prod, have hashes because that's part of what CSS Modules uses to avoid collisions.

Besides download size, smaller names improve parsing speed too.

➕ show 1 reply
notpushkin • today at 8:11 AM

This.

The only thing hashing classes achieves is making it difficult for users to use ad blockers and/or custom CSS. I understand why e.g. Meta does it on their sites, but for GitHub it makes no sense.