I am trying to deploy a GWT client-only app on a custom web server. I am using the GWT pre-compress linker like this in my .gwt.xml file:
<inherits name="com.google.gwt.precompress.Precompress"/>
<set-configuration-property name="precompress.leave.originals" value="false" />
<add-linker name="xsiframe" />
And in my html file, I load the javascript with references to nocache.js.gz:
<script type="text/javascript" src="app/app.nocache.js.gz"></script>
The compiler generates compressed javascript files as expected. However, when I run the app, the app is requesting *.cache.js files from the web server, and not *.cache.js.gz files as I was expecting.
I am using a custom web server that does not handle compression on-the-fly, so I am wondering if there is a way to configure GWT compiler to generate code that requests *.cache.js.gz files instead of *.cache.js files? I can’t seem to find any documentation for this, but if I’ve missed something in the docs, I’d appreciate a pointer.
The PrecompressLinker will generate the .gz files.
However not all browsers support precompressed resources and thus they won’t be loaded by default.
You have to configure your web-server/backend server so that it check if there precompressed resources available and if the client supports compression and then rewrites the request to retrieve the *.gz files instead of the non compressed ones.