gzip js

classic Classic list List threaded Threaded
2 messages Options
hcr
Reply | Threaded
Open this post in threaded view
|

gzip js

hcr
Hi.
   1. problem with static-zip js
   I want to static-zip xforms.js. I do that:
First, tranfrom xforms.js to xforms.js.gz with gzip.exe;
Second, replace xforms.js in oxf:/ops/javascript with xforms.js.gz;
Third, modify XHTMLHeadHandler.java, The result code like that,
   scripts = {
      ...
      //new ResourceConfig("/ops/javascript/xforms.js", null),
      new ResourceConfig("/ops/javascript/xforms.js.gz", null),  
      ...
   }
End, compile OPS.
 
   When I run OPS Example with My OPS, I receive a problem: js error. I find that Client don't download xforms.js.gz from Server. How can I do?
   I just want to static-gzip js.
 
   2. dynamic-gzip js
   I use Tomcat 5.0 run OPS. I want to use dynamic-gzip with Tomcat. So I config server.xml of Tomcat like that:
    <Connector
        port="8080"              
        maxThreads="150"
        minSpareThreads="25" maxSpareThreads="75"
        enableLookups="false" redirectPort="8443" acceptCount="100"
        debug="0" connectionTimeout="20000" 
        disableUploadTimeout="true"
     
        compression="on"
        compressionMinSize="2048"
        noCompressionUserAgents="gozilla, traviata" 
        compressableMimeType="text/html,text/xml,text/css,text/javascript"      
      />
  
   But the performance is not upgrade. Why ? Do I config error? 



女 友 9 9 元 b u y 的 新 款 O N L Y
秋 冬 女 人 精 品 女 装 全 场 火 热 促 销 2 9 元 - 1 9 9 元 , 抢 呀 ( 图 )

--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: gzip js

Erik Bruchez
Administrator
>    1. problem with static-zip js

>    I want to static-zip xforms.js. I do that:
> First, tranfrom xforms.js to xforms.js.gz with gzip.exe;
> Second, replace xforms.js in oxf:/ops/javascript with xforms.js.gz;
> Third, modify XHTMLHeadHandler.java, The result code like that,
>    scripts = {
>       ...
>       //new ResourceConfig("/ops/javascript/xforms.js", null),
>       new ResourceConfig("/ops/javascript/xforms.js.gz", null),
>       ...
>    }
> End, compile OPS.
>
>    When I run OPS Example with My OPS, I receive a problem: js error. I
> find that Client don't download xforms.js.gz from Server. How can I do?
>    I just want to static-gzip js.
When sending gzipped content to a browser, some HTTP headers must be
present, otherwise the browser will just think that the content is
uncompressed JavaScript. In particular, you must have:

Content-Encoding: gzip

This is why, if you want to have pre-gzipped files, you should serve
them from an Apache web server, for example, where you can configure
that kind of headers easily.

I think that dynamically gzipping (as you try to do below) is easier
to setup. And you can do that with Tomcat or Apache.

>    2. dynamic-gzip js
>    I use Tomcat 5.0 run OPS. I want to use dynamic-gzip with Tomcat. So
> I config server.xml of Tomcat like that:
>     <Connector
>         port="8080"
>         maxThreads="150"
>         minSpareThreads="25" maxSpareThreads="75"
>         enableLookups="false" redirectPort="8443" acceptCount="100"
>         debug="0" connectionTimeout="20000"
>         disableUploadTimeout="true"
>
>         compression="on"
>         compressionMinSize="2048"
>         noCompressionUserAgents="gozilla, traviata"
>
compressableMimeType="text/html,text/xml,text/css,text/javascript"
>       />
>
>    But the performance is not upgrade. Why ? Do I config error?

The configuration above looks about right. Can you use something like
tcpmon to see whether the JavaScript files are in fact gzipped? See:

  https://tcpmon.dev.java.net/

-Erik

--
Orbeon Forms - Web Forms for the Enterprise Done the Right Way
http://www.orbeon.com/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws