In our application we use Sencha GXT and GWT 2.7.
Unfortunately there's often the following error displayed in a pop-up:
Download of /path/deferredjs/SOMEGENERATEDID failed with status 404 ("Script Tag Failure - no status available")
It only seems to occur when a new version of the application has been deployed. Clearing the browser cache solves the problem.
I found out that this error occurs in the class ScriptTagLoadingStrategy.java
in GWT.
Is there another way to solve this problem other than clearing the browser cache every time it occurs?
It seems that your HTTP's server configuration regarding caching is not properly configured to work with GWT.
According to the documentation:
*.nocache.*
should not be cachedThere's an example configuration for Apache HTTP server in the documentation too.
The *.nocache.js
file is a bootstrap script:
This file is responsible for choosing the correct version of your application to load for your client based on their browser and locale (...). The various versions of your application compliant to each browser / locale are the
<md5>.cache.html
application files.
In short: the bootstrap file changes every compile and is a "gateway" to your application. It selects which <md5>.cache.*
application version to load. Its name has to be constant because you are referencing it from your host page. Since <md5>.cache.*
files' names change with every source code change (because its name is its content's MD5 hash), they can be safely cached.
So what is happening is that an old bootstrap script is cached (and loaded instead of the new one) and it's trying to load an old version of your application (one of the *.cache.*
files). However, those files have been probably removed by the compilation/redeploy, hence the 404
.