GWT - nocache.js cached

I got a problem when my GWT site keep notifying there is no file found for deferred binding js file. After simple investigation, I realize the main nocache.js file is cached. I thought it will be cache automatically but I was wrong.

A simple solution is to make web server to send a header not to cache the nocache.js files.
I found the solution here :
http://www.askapache.com/htaccess/using-http-headers-with-htaccess.html
http://code.google.com/p/google-web-toolkit/issues/detail?id=4823

Simply modify the .htaccess file (I use this file for compression) and put the following configuration:

<filesMatch "\.(nocache.js)$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>

or this one
<Files *.nocache.*>
  ExpiresActive on
  ExpiresDefault "now"
  Header merge Cache-Control "public, max-age=0, must-revalidate"
</Files>


Voila !!!. :)


 
 

0 comments:

 
Copyright © peyotest