Preventing cache of SWF clips embedded in JSP pages


Working on LeCoOnt application I faced the problem that SWF files embedded in LeCoOnt JSP pages were cached. So when one calls the same JSP for the 2nd time the browser does not load the clip, saying “Clip not loaded”.
After cleaning up the cache, the page is working correctly again.

Somehow I also noticed that the problem was worse for the Intranet pages and was normally working when my Tomcat hosting the JSPs was tunnelled to Apache to provide the access to outside of our local network.

After some research in the internet I found a solution that is working:

<object id=”<%=clipGUID%>” classid=’clsid:D27CDB6E-AE6D-11cf-96B8-444553540000′ width=”100%” height=”100%”>
<param name=”src” value=”flex/<%=clip%>?nocache=<%= new Date().getTime()%>”/>

I.e. to the name of the SWF-file to be loaded with the object-tag I add some parameter that is being modified every time the JSP is called.

Hopefully it would help others.

Tags: , , ,

Leave a comment