httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beer Dr. Thomas" <>
Subject RE: Re: [users@httpd] Pack200 & Content Negotiation
Date Fri, 22 Oct 2010 09:04:18 GMT
Actually, I would like to avoid such a redirection. The reason is that I
suspect that such a redirection may slow down the performance. What do
you think?


What do you think about a Java-Script based solution such as:

if (installedJRE < 1.5)

      applet invocation: ... <archive="First.jar">


      applet invocation: ... <archive="First.jar.pack.gz">



Kind regards,



Von: Jess Holle [] 
Gesendet: Donnerstag, 21. Oktober 2010 19:20
Cc: Beer Dr. Thomas
Betreff: Re: [users@httpd] Pack200 & Content Negotiation



I used to try to do something via Apache for this, but I gave up a long
time ago and started handling this via a Java servlet filter and
directing *.jar requests to the servlet engine.  This also allows me to
set jar version information in the response headers in the same servlet.

Of course, I end up using this sort of approach much of the time as (1)
I have to support other web servers than just Apache and (2) writing a
servlet filter is far easier than attempting to write an Apache module
(we don't deploy modules for Perl, PHP, etc -- and the Java servlet API
is far easier for me to deal with than Perl, PHP, etc, anyway).

Jess Holle

On 10/21/2010 11:43 AM, Beer Dr. Thomas wrote: 

Dear all,

to speed up our applet based application we are using the "pack200"
compression for the corresponding jar-files (e.g., First.jar, see
example below). The applet is hosted on Apache 2. Unfortunately we have
to support "old" JREs such as JRE 1.4.2 as well. Therefore, as pack200
is not supportet in Java 1.4, the uncompressed "version" of the jar-file
should be delivered if requested by a browser with Java plugin ver.

I did not manage it to configure Apache according to these requirements.

Using the following configuration always (both, for JRE 1.4 and for JRE
1.6) delivers the "unpacked" jar-file (i.e., unpacked/First.jar):

AddType application/x-java-archive .jar
AddHandler type-map var
Options +MultiViews
MultiviewsMatch Handlers
AddEncoding pack200-gzip .jar
RemoveEncoding .gz

a) First.jar.var
URI: First.jar

URI: packed/First.jar.pack.gz
Content-Type: x-java-archive
Content-Encoding: pack200-gzip

URI: unpacked/First.jar
Content-Type: x-java-archive

Using configuration b) instead (see below), delivers the packed
(compressed) jar-file (i.e., packed/First.jar.pack.gz) for both, JRE 1.4
and JRE 1.6:

b) First.jar.var
URI: First.jar

URI: packed/First.jar.pack.gz
Content-Type: x-java-archive
Content-Encoding: pack200-gzip

What I'm doing wrong? 

I really appreciate your help, 



View raw message