Vousk-prod. Posted December 16, 2014 Share Posted December 16, 2014 Hi people, Nice idea to use gzip version of babylon.js file, thank you DK !the minified version is less than 600k and we use gzip on it to go down less than 100k But to optimise more, I also activated on my apache server automatic gzip of .babylon files (for those that could help, it could be done in the .htaccess :AddOutputFilterByType DEFLATE application/babylon \ application/babylonmeshdataAnd now I cannot anymore express the loading progress in %, as if progress.lengthComputable is no more computable.Is that normal or I'm doing something wrong ? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted December 16, 2014 Share Posted December 16, 2014 Unfortunately this is normal. My IIS server is doing the same Quote Link to comment Share on other sites More sharing options...
AVENGER NO WAR Posted December 17, 2014 Share Posted December 17, 2014 does your server sends the CONTENT-LENGTH header to the client? Quote Link to comment Share on other sites More sharing options...
Vousk-prod. Posted December 18, 2014 Author Share Posted December 18, 2014 I don't know. I can't configure directly the apache conf.But I can add anything in .htaccess, is it possible to make the server send this header via htaccess ? Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted December 18, 2014 Share Posted December 18, 2014 Knowledge of apache configuration is not actually required to know if content length is being sent. Here is how to tell in Java. How it might translate into Java script is unknown, but running this against a url on your server will tell you if you should care.import java.io.*;import java.net.*;public class Length { public static void main(String[] args) throws Exception { final String addr = (args.length > 0) ? args[0] : "http://svn.code.sf.net/p/cmusphinx/code/trunk/cmudict/cmudict.0.7a"; DataInputStream response = null; HttpURLConnection con = null; try{ final URL site = new URL(addr); con = (HttpURLConnection) site.openConnection(); // set attributes prior to actually connecting con.setUseCaches(false); con.setConnectTimeout(0); con.setReadTimeout(0); // connect & check response, store cookie, & get response data con.connect(); final int returnCode = con.getResponseCode(); if (returnCode == HttpURLConnection.HTTP_OK){ response = new DataInputStream(con.getInputStream() ); int length = con.getContentLength(); System.out.println( (length != -1) ? "Known length of " + length : "unknown length"); }else{ throw new Exception(addr + " Web site responded: " + con.getResponseMessage() + ", response code: " + returnCode); } }finally{ if (response != null) response.close(); if (con != null) con.disconnect(); } }}Never ran this myself, but I did chop it out of a program to retrieve / build an Arpabet database, and it compiles. 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.