Jump to content

Any way to compress the .babylon file?


ozRocker
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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-javascript

This allows compression to server and to decompression to client automatically

 

http://www.feedthebot.com/pagespeed/enable-compression.html

Link to comment
Share on other sites

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 = 4

Changing 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...