Hello List,
I want to give back some information how I succeded to serve a staticaly
compressed qooxdoo.js file with a fallback for loading the non
compressed version.
Some firewalls are configured to filter compressed files so the users
behind this firewall have no access to the compressed qooxdoo.js. The
compressed file is qooxdoo.jsz which was compressed by gzip. Here is
what I did.
1) Configured apache through .htaccess to send back the right mime type:
AddEncoding x-gzip .jsz
AddEncoding gzip .jsz
2) Included the following lines in my qooxdoo-ish html files:
<script type="text/javascript" src="/qooxdoo/public/qooxdoo.jsz"></script>
<script type="text/javascript" language="JavaScript">
if( typeof(QxMain) == 'undefined' ) {
document.write("<SCR" + "IPT LANGUAGE='JavaScript'
SRC='/qooxdoo/public/qooxdoo.js' TYPE='text/javascript'><\/SCR" + "IPT>");
}
for the new namespace branch the line should be:
<script type="text/javascript" src="/qooxdoo/public/qooxdoo.jsz"></script>
<script type="text/javascript" language="JavaScript">
if( typeof(qx) == 'undefined' ) {
document.write("<SCR" + "IPT LANGUAGE='JavaScript'
SRC='/qooxdoo/public/qooxdoo.js' TYPE='text/javascript'><\/SCR" + "IPT>");
}
The paths to the qooxdoo.js and qooxdoo.jsz have to be adapted according
to your configuration.
The first script tag tries to load the zipped file. If this gets its way
to the clients browser and the client is able to uncompress the file and
interprete it there should be a object named QxMain. If this object is
undefined we asume that there was an error loading and running qooxdoo.jsz.
The second script tag adds dynamically a script tag through
document.write which then tries to load the uncompressed qooxdoo.js.
Hope someone finds this usefull.
--
Mit freundlichen Grüßen
Dietrich Streifert
Visionet GmbH
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel