Topic: how to prevent XML file from caching


I have been searching for a way to prevent the gallery.xml file from caching in the browser.

When I make changes to it, I have to force the browser to pull it up via it's URL, and then do a reload.  This works fine for me, but the average person viewing my site won't know to do this.

Is there any way to tell simpleviewer (or the browser) to load a new copy of the xml file if it has been modified?

Any help is certainly appreciated.

Re: how to prevent XML file from caching

Try defining your gallery's XML file with a unique query string identifier (e.g. the current time which will be different each time a user loads the page) using the galleryURL option in your gallery's embedding code.

<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", "100%", "100%", "222222", true, flashvars);
<div id="sv-container"></div>
Steven Speirs
SimpleViewer Support Team

Re: how to prevent XML file from caching


That works perfectly.  What a huge difference.  Thank you so much.