Apparently there could be some issues with some browsers.
This blog post 
http://rickchristie.com/blog/2010/note/gzip-in-safari-doesnt-work-not/ states 
it happens with safari 4.0 unless the js file extension is changed from .js.gz 
to .jgz
I had a look at many websites about JS optimization and I always read about 
server side proper configuration. Plus, when you download a js library, there 
is always a minified version ready for production sites but I can't remember 
seeing a gziped version of the library (which I think would exist if it would 
work out of the box). In one case (TinyMCE), I remember of an extra php file to 
take care of compressing js and css on the fly.
It's not my area of expertise, and I agree that if we can be sure this strategy 
is working, we should implement it (and we don't have to care for all browsers 
as, for example, jsmol relies on canvas for rendering, it's not necessary to 
achieve compatibility with IE<9). Maybe testing is required.
Paul


Le 19 nov. 2012 à 22:57, Evans, Michael James a écrit :

> Bob,
> Yes, you should try it! :-) Modern browsers know how to "handle" gzip files. 
> Think of it this way: if you open an MP3 file in your browser, the browser 
> plays it, right? The MP3 doesn't open in another application unless you 
> explicitly tell it to or download it. In similar fashion, gzip files are 
> handled by the browser too. They just get unzipped and the unzipped file gets 
> pulled in and processed by the browser.
> 
> Cheers, Mike
> 
> On Nov 19, 2012, at 3:51 PM, Robert Hanson <[email protected]> wrote:
> 
>> 
>> 
>> 
>> On Mon, Nov 19, 2012 at 3:41 PM, Paul Pillot 
>> <[email protected]> wrote:
>> So... by combining all the JSmolxxxx.js files (including the huge three.js 
>> library for webGL) in a minimified version, I got a 418kB file which gziped 
>> as a 90kB file.
>> accessing jquery from CDN, lead to download a 33kB compressed file and 
>> core.js is still compressed accounting for 560kB
>> test2.htm loaded in a 772kB transfer after 54 requests.
>> As I mentioned previously there is a bunch of extra files which I think 
>> could be related to a difference of version between the jsmol zip file I 
>> downloaded (version 11/13/2012) and the actual online version (11/18/2012). 
>> I presume that without these extra requests the initial load would amount to 
>> 700kB. Bob, can this be fairly compared with the 1MB JmolApplet0.jar file ?
>> 
>> 
>> Quite possibly.  You should be able to use the files in 
>> http://chemapp.stolaf.edu/jmol/jsmol.zip and have NO org/jmol downloads and 
>> NO java/ downloads for anything that is not biological. If you see any 
>> additional files, then something is wrong with the compression. Function 
>> names have changed, for example. But, yes, I would say 1 MB is our target, 
>> since that is the size of JmolApplet0.jar. 
>> 
>> I don't understand the gzip business. Do all browsers now accept gzipped .js 
>> files? How does that work?
>> 
>> Bob
>> 
>>  
>> For information, here is how I processed :
>> - fetching JQuery from CDN :
>> <script 
>> src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
>> - minimifying JS files using uglifyjs2 (after installing node and the 
>> uglifyjs2 package through npm) https://github.com/mishoo/UglifyJS2
>> - core.z.js : 
>> uglifyjs2 core.z.js -o core.js --compress
>> - JSmolxxx.js files
>> uglifyjs2 JSmolCore.js JSmolApplet.js JSmolApi.js JSmolThree.js 
>> JSmolGLmol.js j2s/j2sjmol.js JSmol.js -o JSmol.min.js --compress unsafe=false
>> (using --compress without specifying the unsafe=false argument breaks this 
>> code)
>> - changing the script tags :
>> <script type="text/javascript" src="JSmol.min.js"></script>
>> 
>> For server side js files compression I edited the httpd.conf file of my 
>> Apache server in accordance with this tutorial :
>> http://www.techiepark.com/tutorials/how-to-enable-gzip-compression-in-apache-server-to-speed-up-website/
>> mol and pdb files also benefit from this setting
>> 
>> Paul
>> 
>> Le 19 nov. 2012 à 20:52, Paul Pillot a écrit :
>> 
>>> It works and caffeine is loaded after a 871kB download ! core.js is sent as 
>>> a 564kB file.
>>> Surprisingly 43 js files are loaded after core.js (shaperenderer.js, 
>>> ballrenderer.js, deflate.js, gzipheaders.js to name a few). Those files are 
>>> not loaded on the test page delivered by the chemapps... server. Something 
>>> might have happened somewhere in the ugglifying process ?
>>> 
>>> Still, a remaining 307kB might be reduced by compressing the main libraries 
>>> (JSmolApi.js and the like) and downloading jquery through google api cdn.
>>> 
>>> Paul
>>> 
>>> Le 19 nov. 2012 à 19:02, Robert Hanson a écrit :
>>> 
>>>> go ahead and change that name. It is referenced in j2s/java/package.js
>>>> 
>> 
>> 
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov
>> _______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
>> 
>> 
>> 
>> 
>> -- 
>> Robert M. Hanson
>> Larson-Anderson Professor of Chemistry
>> Chair, Chemistry Department
>> St. Olaf College
>> Northfield, MN
>> http://www.stolaf.edu/people/hansonr
>> 
>> 
>> If nature does not answer first what we want,
>> it is better to take what answer we get. 
>> 
>> -- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900
>> 
>> 
>> ------------------------------------------------------------------------------
>> Monitor your physical, virtual and cloud infrastructure from a single
>> web console. Get in-depth insight into apps, servers, databases, vmware,
>> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
>> Pricing starts from $795 for 25 servers or applications!
>> http://p.sf.net/sfu/zoho_dev2dev_nov_______________________________________________
>> Jmol-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/jmol-users
> 
> ------------------------------------------------------------------------------
> Monitor your physical, virtual and cloud infrastructure from a single
> web console. Get in-depth insight into apps, servers, databases, vmware,
> SAP, cloud infrastructure, etc. Download 30-day Free Trial.
> Pricing starts from $795 for 25 servers or applications!
> http://p.sf.net/sfu/zoho_dev2dev_nov_______________________________________________
> Jmol-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/jmol-users

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users

Reply via email to