7 ms·
> That would mean adding almost 2,260 URLs to the JavaScript. This might sound reasonable This is one of the many things in today's web I have a problem with.
by hdjjhhvvhga 5y ago
> That would mean adding almost 2,260 URLs to the JavaScript. This might sound reasonable
This is one of the many things in today's web I have a problem with.
- dbbk 5y agoIt actually doesn't sound reasonable, I have no idea what they're talking about.
- hdjjhhvvhga 5y agoTo all downvoters: please consider that 2260 URLs with 100 characters each make 226 KB. That's 1/4th of a megabyte... On a news site! And for what?! As if infinite scroll wasn't bad enough, you now have the solution you wouldn't have in the first place if you hadn't decided that it's an excellent idea to play with the user's brain by displaying new articles masquerading as the continuation of the previous one. Yes, I know, the ship has sailed, but the whole issue still bothers me.
- zimpenfish 5y agoI've scraped the country pages, and then the internal links, removed all the URLs they won't be scroll-tracking (like '/email-signup'), and turned them into a JS file for a total size of 153742 bytes uncompressed. If you take advantage of the fact that all those country pages share a prefix, you can get the array down to 84423[1] (whilst still knowing the prefix.) Convert it to plain text (because you don't always need it immediatelyas an array) and it comes down to 81399. Then use `lz-string` to compress it and you end up with 26656 bytes. Also since there's only 226 unique prefixes for the links, you could use another level of prefix removal and get it down even further - the JS array is now 38659 bytes, which `lz-string` gets down to 9372 bytes. I'm pretty sure someone smarter than me can get it down even further. [edit: discovered some blank URLs that could be stripped]
- zimpenfish 5y agoFor comparison, the crown SVG included on every single page is 2043 bytes.
- JoelEinbinder 5y ago2260 * 100 bytes = 226kb not 226mb.
- hdjjhhvvhga 5y agoSorry, I got confused - but the argument still holds, it's absurd.
- makapuf 5y ago226K uncompressed, I'm sure some of the url share prefixes so even a very simple, handcrafted scheme would compress somewhat.
- zimpenfish 5y agoI can get it down to 38726 bytes as a JS array, or 9490 if you use `lz-string` on that.