Earlier quoted context omitted.
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.
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 problema…
JSZip: Create, read and edit .zip files with JavaScript
11–20 of 57 posts
Re: JSZip: Create, read and edit .zip files with JavaScript
#12Re: JSZip: Create, read and edit .zip files with JavaScript
#13Potential use case: instead of using CSS sprite maps (putting all of your images into one image to reduce the number of http requests generated by your page, then using css magic to select regions inside of that image), image files could be zipped into an image package that is delivered to the client, who unzips it and uses the images inside. This would cut down on the number of requests made, but allow the images to…
Re: JSZip: Create, read and edit .zip files with JavaScript
#14JSZip works well for small files, but unzipping XLSB files larger than 50M seem to cause out of memory issues in Firefox
Re: JSZip: Create, read and edit .zip files with JavaScript
#15Potential use case: instead of using CSS sprite maps (putting all of your images into one image to reduce the number of http requests generated by your page, then using css magic to select regions inside of that image), image files could be zipped into an image package that is delivered to the client, who unzips it and uses the images inside. This would cut down on the number of requests made, but allow the images to…
Re: JSZip: Create, read and edit .zip files with JavaScript
#16Re: JSZip: Create, read and edit .zip files with JavaScript
#17Earlier quoted context omitted.
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.
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 problema…
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.
Re: JSZip: Create, read and edit .zip files with JavaScript
#18Potential use case: instead of using CSS sprite maps (putting all of your images into one image to reduce the number of http requests generated by your page, then using css magic to select regions inside of that image), image files could be zipped into an image package that is delivered to the client, who unzips it and uses the images inside. This would cut down on the number of requests made, but allow the images to…
Some images formats already come with compression. Also, zip doesn't work with well with binary data. Using CSS to "subscript" into the sprite is a better solution.
Re: JSZip: Create, read and edit .zip files with JavaScript
#19Re: JSZip: Create, read and edit .zip files with JavaScript
#20Potential use case: instead of using CSS sprite maps (putting all of your images into one image to reduce the number of http requests generated by your page, then using css magic to select regions inside of that image), image files could be zipped into an image package that is delivered to the client, who unzips it and uses the images inside. This would cut down on the number of requests made, but allow the images to…
Some images formats already come with compression. Also, zip doesn't work with well with binary data. Using CSS to "subscript" into the sprite is a better solution.
Sure, you can build the spriting into your build process, but I don't know how to do that (I'm sure there are tools) and you can't exactly use normal css since the coordinates of your images may change within the sprite sheet.
Using the zip method saves you some of that headache/overhead with the tradeoff of having to package your images into a zip and unzip them on the client side.