3 ms·
I'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 J
by zimpenfish 5y ago
I'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.