3 ms·
What they fail to mention is that you lose the ability to remove unused code, for example when you would otherwise import only some Bootstrap components' JS. S
by fxtentacle 6y ago
What they fail to mention is that you lose the ability to remove unused code, for example when you would otherwise import only some Bootstrap components' JS.
So in the end, their hosted copy might be much larger than if you had hosted an optimized copy yourself.
Using their service, it is also impossible for you to merge small dependencies and your application logic into one file to reduce the number of HTTP requests. The resulting higher number of gets might well make it slower than not using their CDN in the first place.
- blaisio 6y agoYou lose the ability to remove unused code, but for people using this, it doesn't matter, because it is cached anyway. The number of HTTP requests really does not matter much these days, because of HTTP2. And again for people who use this service and get a speedup from it, it doesn't matter because it is cached.
- Quekid5 6y ago> You lose the ability to remove unused code, but for people using this, it doesn't matter, because it is cached anyway. I was under the impression that parsing (etc.) time matters as well, not just raw download time/latency?
- JMTQp8lwXL 6y agoYou assume I can use HTTP/2. I've pleaded with my upstream service owners to no avail. Since they control network traffic, I have no choice.
- manigandham 6y agoWhat do you mean by upstream service owners? All you need for HTTP2 is for your browser to support it as you download from the CDN domain.
- JMTQp8lwXL 6y agoIn my organization, someone else controls the traffic that arrive to servers that host things like CDN assets. And it's all HTTP 1.1.
- no_wizard 6y agoWell yes and no, this will depend on how you build and serve the dependency graph. If they did their diligence with the production build you should be able to Optimize re-usability of common imports as well as optimizing modules to only import the bare minimum of what’s needed. Now granted as far as I can tell from a technical perspective in absolute terms you will always get the best builds tuning your builds locally, however it’s not all or nothing either
- gitgud 6y ago> So in the end, their hosted copy might be much larger than if you had hosted an optimized copy yourself. But you could upload your optimized copy to their platform right?
- bhl 6y agoI wouldn't be surprised if Skypack eventually supported the ability to remove unused code: that's a core concept in Snowpack, an unbundled development tool, also built by Pika CDN. [1] https://www.snowpack.dev/#using-npm-dependencies https://www.snowpack.dev/#using-npm-dependencies
- vimslayer 6y agoThere are lots of libraries that don't really support dead code removal via stuff like tree saking anyway. React, moment.js, Bluebird, etc