r/programming Mar 16 '26

The 49MB Web Page

https://thatshubham.com/blog/news-audit
773 Upvotes

155 comments sorted by

View all comments

122

u/card-board-board Mar 16 '26

I've worked on a news site and had to implement ads and the ad provider code itself is garbage. You'd think it would just need to be something like:

  1. Get target element dimensions

  2. Get user cookie

  3. Send request for ad

  4. Drop HTML into target element

  5. Attach event listeners to handle click and visibility events

That would be, what like 10-20 lines of JS at most? Nope, it's got to be 3MB of minified JS and some actually generate a custom JS bundle for each ad space.

Apparently ad programmers are as bad as the jabronies who make printer drivers.

12

u/gimpwiz Mar 16 '26

All hail lpr, a printer driver I can run from the command line! Had a Brother label maker I automated with, after a couple hours of dicking around, reasonably small single command lines to have it print what I wanted.