3 ms·
Nice, simple solution! Feedback: the JS to include should be minified, and the instructions should say to either place the script tag at the bottom of the 'bod
by allover 9y ago
Nice, simple solution!
Feedback: the JS to include should be minified, and the instructions should say to either place the script tag at the bottom of the 'body' tag (not in the head), or to add the 'async' attribute to the script tag (or do what Google Analytics does and include a bit of inline JS to async-load the script).
(Otherwise rendering of the page is blocked by a 3rd party script, which is a pretty bad situation).
- onion2k 9y agoOn that note, the script really needs a subresource integrity hash[1]. As it's included at the moment the author could modify the code at webtigerteam to do anything. By putting an integrity hash in the script tag people could use this without worrying about future changes doing bad things. [1] https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity https://developer.mozilla.org/en-US/docs/Web/Security/Subres...
- MichaelGG 9y ago... by exchanging it for worrying about the feature breaking every time a minor fix is pushed. If you're going to go through the hassle of manually pinning versions, then just download and host the code alongside your site.
- mrweasel 9y ago>the JS to include should be minified Why? I mean sure you save a little traffic, but it could just as well be gzipped.
- anc84 9y agoMinifying does more. Original: 26282 Minified: 10562 Gzipped Original: 7633 Gzipped Minified: 4109
- z3t4 9y agoNot only does minifying save bandwidth it will also make the script parse and run faster! We are talking about 30% speed increase! It's huge! We'll save ONE MILLISECOND! Seriously though, minifying does only make sense on huge scale, I would need to serve that script 15,000 times per second to saturate a GbE link. And for those poor users who pay outrageous costs for downstream by the MB, they would save around 0.003 cent if it was minified. Lets instead consider the costs for minifying the script, like being able to more easily debug it in production. And maybe someone wants to actually view the source code, figure out how it works, and tinker with it, now that's worth something!
- allover 9y agoYou're forgetting about mobile phones. Seriously, bytes matter because mobile networks suck, especially in emerging markets. Minification is worth it. Make the source code available on github.
- anc84 9y agoHi, I am currently paying 15$ for 75MB of data. Thank you very much to everyone who obsessively optimise their web code, as it is worth it for weirdos like me.