Topic: Clear Cache Method?

I don't see any other posts regarding this but I know I'm not the only one who has to deal with the SWF file being cached in the browser.  sad

I love SimpleViewer and have used it for years, and I make regular changes to my galleries.  But I'm afraid that viewers are missing my updated images by not clearing their browser cache.

Is there no way (using JavaScript) to load the latest SWF file or clear the browsers cache?  Has this been addressed lately?

Thanks so much.

Re: Clear Cache Method?

But I'm afraid that viewers are missing my updated images by not clearing their browser cache.

Missing updated images will be caused by the gallery's XML file, rather than the SWF file, being cached.
Try defining your gallery's XML file with a unique identifier (eg. the current time which will be different each time a user loads the page) using the xmlDataPath option. Use the following code before the fo.write("flashcontent"); line in your embedding code.

fo.addVariable("xmlDataPath", "gallery.xml?nocache="+new Date().getTime());
Steven Speirs
SimpleViewer Support Team.

Re: Clear Cache Method?

Excellent!  Thank you.

Re: Clear Cache Method?

And for Version 2, this worked for me (in bold):

                <!--START SIMPLEVIEWER EMBED.-->
                <script type="text/javascript" src="svcore/js/simpleviewer.js"></script>
                <script type="text/javascript">
                    var flashvars = {};
                    flashvars.galleryURL = "gallery.xml?nocache="+new Date().getTime();               
               
                    simpleviewer.ready(function () {
                    simpleviewer.load("sv-container", "500", "500", "FFFFFF", true, flashvars);
                    });
                </script>
                <div id="sv-container">
                </div>
                <!-- END SIMPLEVIEWER EMBED -->

Last edited by mjellis (2012-04-21 05:46:17)