gzip compiler output

41 views
Skip to first unread message

Andrej

unread,
Apr 25, 2008, 2:37:22 AM4/25/08
to Google Web Toolkit
hi,

my idea is to implement additional GWTCompiler argument "-gzip", which
will produce also gzipped files:
*.cache.html
*.cache.html.gzip

and
<module>.nocache.js
<module>.nocache.gzip.js

in this case my server side script will generate:

<script type="text/javascript" src="<module>.nocache.gzip.js"></
script>
OR
<script type="text/javascript" src="<module>.nocache.js"></script>
based on server gzip support.

is there any existing (or planned) solution in gwt to support gzip in
this way?
thanks

kilkenny

unread,
Apr 25, 2008, 3:31:43 AM4/25/08
to Google Web Toolkit
You can easily do that with an Ant or Maven task while building the
project. I assume most people use some kind of build system to create
their production builds.

Regards, Adrian

Andrej

unread,
Apr 25, 2008, 4:05:21 AM4/25/08
to Google Web Toolkit
*.cache.html.gzip can be created during build, but
<module>.nocache.gzip.js is NOT gziped version of
<module>.nocache.js,
but script which should load gzipped version of one of the
cache.html.gzip

ok, it is possible to do string replace of '.cache.html' in
<module>.nocache.js

but it will be nice to implement -gzip switch

a.

Folke

unread,
Apr 25, 2008, 8:34:15 AM4/25/08
to Google Web Toolkit
I'm using a simple ServletFilter that looks for a compressed version
of the request resource ("<URI>.gz" or "<URI>.deflate"), compares
modify time, and then outputs the gzipped resource with the necessary
HTTP headers set (Content-Type, Content-Encoding, etc.). Completely
transparent to the client.

I also wrote a small Ant task that recourse into GWT output directory
and compresses HTML, JS, CSS, and XML files. Doesn't have to be a GWT
feature. Tomcat's GZIP compression and resource caching is also very
practicable and convenient.

As far as I know the Content-Encoding header has to be set for
browsers to decompress and load scripts.


Andrej schrieb:
Reply all
Reply to author
Forward
0 new messages