ozRocker Posted April 1, 2015 Share Posted April 1, 2015 I have a .babylon file that's 1.171MB. If I gzip it its only 259KB. I'm wondering if there's a way to work with a gzipped .babylon file. Apparently javascript can unzip files but they remain in memory and can't be saved to disk. Is there another way to work with a compressed file? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 1, 2015 Share Posted April 1, 2015 If enabled on your web server, the transmission is compressed, then saved on the client at full size. Quote Link to comment Share on other sites More sharing options...
Dad72 Posted April 1, 2015 Share Posted April 1, 2015 may be with a .htaccess:#compress text, html, javascript, css, xml, json, babylon:AddOutputFilterByType DEFLATE text/plainAddOutputFilterByType DEFLATE text/htmlAddOutputFilterByType DEFLATE text/xmlAddOutputFilterByType DEFLATE text/cssAddOutputFilterByType DEFLATE application/xmlAddOutputFilterByType DEFLATE application/xhtml+xmlAddOutputFilterByType DEFLATE application/rss+xmlAddOutputFilterByType DEFLATE application/javascriptAddOutputFilterByType DEFLATE application/jsonAddOutputFilterByType DEFLATE application/x-javascriptThis allows compression to server and to decompression to client automatically http://www.feedthebot.com/pagespeed/enable-compression.html Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted April 1, 2015 Share Posted April 1, 2015 A more radical way would be to reduce the precision of the data written to file, and see if the results are acceptable. Close to the beginning of the file are some constants:# output related constantsMAX_VERTEX_ELEMENTS = 65535VERTEX_OUTPUT_PER_LINE = 1000MAX_FLOAT_PRECISION = '%.4f'MAX_INFLUENCERS_PER_VERTEX = 4Changing MAX_FLOAT_PRECISION to say '%.3f' would reduce the length of some numbers. Not all, since exporter already removes trailing 0's and un-neccessary dots. VERTEX_OUTPUT_PER_LINE could also be increased, but savings would be negligible, make looking a the file really hard if you had to. Quote Link to comment Share on other sites More sharing options...
ozRocker Posted April 1, 2015 Author Share Posted April 1, 2015 Turns out my web server is already compressing the files before serving them so GZIP is already enabled. IE turned my 1.1MB file into a 115KB file but for some reason Chrome didn't compress it even though it compressed all the other files. I saw a bug report about Chrome not compressing static files bigger than 1MB but it mentioned it had been fixed. I have the latest Chrome so I thought it could be something I've done, unless the bug returned somehow Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.