Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Consider something like bootstrap, which allows you to customize your download before sending you a zip file.

The assets are already loaded (since you're viewing the bootstrap demo page), so instead of making a request to another server to generate some sort of compressed file for you, that labor is offloaded to the client.



In fact the bootstrap customizer does indeed use JSZip to create the zipped download! See http://getbootstrap.com/assets/js/customize.min.js


Except you're unnecessarily bogging down the user's browser to a far greater extent (base64 encoding/decoding everything on a possibly underpowered CPU/IO) than the amount of work it would take to do it on the server (pure binary processing on a high end CPU).

I'm guessing Bootstrap can do it because they know most Bootstrap users are developers with decent PCs but for a more mainstream audience, it would be problematic.


Have you used Mega.com? It does in-browser (JavaScript) encryption of uploads and downloads. And I can still hit 5 MB/s throughput. JavaScript can handle Zip compression easily.

For most users, bandwidth is in shorter supply than CPU. Especially on mobile (your constrained CPU/IO case), where people are using 3G or worse, which is often even billed by the MB.


Except that most clients are ridiculously overpowered compared to a heavily loaded server. Even the slowest 1.3ghz core 2 duo is better than a high end xeon if there are 10 users at one time.


Once again, a hacker news commenter's idea of what in browser javascript performance is like is ridiculously 15 years out of date.

It's 2014 now. Your iphone is 10 times faster than your 1998 pentium 2. Even with the JS vm penalty.

Unless you're zipping 70mb files, there's no chance you're overwhelming anyone's browser.

The usecase for this is the same you'd have for any desktop application: A handy "binary file format" library. Data portability wins.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: