Hi,
GWT.XML:
We have a small three year old smartgwt project which runs on tomcat without a webserver, and there are no settings on tomcat to not to cache any files, but smartgwt static files like .js and .css files are not cached in browser, which is causing initial application load delay everytime user accesses the application, as mentioned in this link, I have added FileDownload servlet but this only chaching images but not js and css files. Can you please suggest how to cache .js and .css files. I have added release version as request param to static files so that I can cache them and when new release is deployed new file be fetched.
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/Caching.html
Thanks in advance, pls refer to attached jpg for more info.
Code:
<gwtVersion>2.3.0</gwtVersion> <smartGwtVersion>3.0</smartGwtVersion> Tomcat Server 7.0 Browsers: IE, Chrome, Firefox (not tested in others)
Code:
<?xml version="1.0" encoding="UTF-8"?> <module rename-to='xyb'> <inherits name='com.google.gwt.user.User' /> <inherits name="com.google.gwt.xml.XML" /> <inherits name="com.google.gwt.i18n.I18N"/> <inherits name='com.google.gwt.user.theme.standard.Standard'/> <inherits name="com.smartclient.theme.silverwave.SilverWave" /> <inherits name="com.smartclient.theme.enterprise.Enterprise"/> <!-- Supported Locale --> <extend-property name="locale" values="en"/> <extend-property name="locale" values="ja"/> <inherits name='com.smartgwt.SmartGwtNoScript'/> <entry-point class='com.xyz.EtryPoint' /> <source path='client' /> <source path='shared' /> </module>
http://www.smartclient.com/smartgwt/javadoc/com/smartgwt/client/docs/Caching.html
Code:
<servlet> <servlet-name>FileDownload</servlet-name> <servlet-class>com.isomorphic.servlet.FileDownload</servlet-class> <init-param> <param-name>expires</param-name> <param-value>text/javascript:10000000,application/javascript:10000000,text/css:10000000,image/gif:10000000,image/png:10000000</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name>FileDownload</servlet-name> <url-pattern>/isomorphic/system/modules/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>FileDownload</servlet-name> <url-pattern>/isomorphic/skins/*</url-pattern> </servlet-mapping>
Comment