Is it possible to get non-random names for Cache Files from GWT Compile

305 Views Asked by At

When I try to load the war file for my project in the Lighthttp server, I get "filename too long" error from the server for the generated JS files such as this :

"733C57A6999C647D009A3EBA1F5CEF9C.cache.js"

When I compile I am using the collapse all property so only one JS file gets created

I wanted to know if there was something that I could do in the code itself or in the xml file to generate a shorter name before it compiles (I don't want to have to rename the file every time)

Any help would be really appreciated.

2

There are 2 best solutions below

2
Colin Alworth On BEST ANSWER

If you only have one generated permutation, and you want to ignore the cacheing and give the file your own name, you can use the single script linker - this will generate only one JS file with both the selection script and the compiled app. This only works with one permutation.

 <add-linker name="sso" />
0
Igor Klimer On

Unless you are using FAT16 or FAT32, the error lies most likely somewhere else. For most modern filesystems the maximum filename length is usually 255 bytes, so the filename produced by the GWT compiler (in this case 41 characters) should fit easily. Maybe the overall path to the file is too long? Maybe the URL itself?

AFAIK, the generated *.cache.js files contain md5 sums in their names, which is crucial during the bootstrap process, so it's rather unlikely that you can circumvent this. Even if - it'd be unwise to use it in production (for example, because of problems with caching).