Questions about flash caching

  • Hi, I'm wondering if it's possible to somehow make Flash download the panorama xml files and images again after I make some changes, instead of loading it from cache? I know you can clear the browser cache and the flash cache, but that's not very elegant to ask the user to do this. Is there some other way to automatically make flash re-download the content?
    Regards,
    Karel

  • What I do is to change the name of the folder where the tour is and use htaccess to redirect the user.

    For instance, I would have the tour at the address "http://example.com/tour-1.0" and the following configuration in .htaccess:

    Redirect 301 /tour/ /tour-1.0
    Redirect 301 /tour /tour-1.0

    I could then give the customer the address "http://example.com/tour". If later I need to update something, I would change the folder name and configuration to "tour-1.1".

    The problem with this method is that the user will see the URL change. But I haven't had any browser or flash caching problems while using it.

    Note: It's probably also good to disable caching in .htaccess with:

    ExpiresActive On
    ExpiresDefault A0

  • I'm looking into using changing the header information throught he .htaccess file on the webserver for xml files, making them expire within a few hours. And longer for other content.
    This is what goes in the htaccess file:
    ExpiresActive On
    <Files *.xml>
    ExpiresDefault "access plus 1 hours"
    Header set Cache-Control "public,max-age=3600"
    </Files>

  • Klaus:
    Would it be possible to implement versioning for the xml, images and other content in the krpano viewer when it is downloading the content?
    For example, we could put a "version=1.0" string somewhere in the javascript and pass it along to the swf, and then krpano would append "?v=versionumber" to all the gets for xml and images and other content automatically?
    This way we could get around the caching issue. Anytime we change something and want people to re-download, or invlaidate their cache, we could just change the version number we pass along to the viewer in one single spot.
    Is this a possibility?

  • It's a question, I know it works fine, but I was asking Klaus for an implementation in the viewer directly so that it would be easier for us to manage (at least the way I see it). If you can just pass the version number to krpano in the javascript in 1 place, then you don't have to change many xml files yourself with version numbers in case you manage a big project, which is what my project is going to become in the future. I'm asking more for an automated feature in krpano for this...

  • And to clearify a bit more, say I have a panorama defined in pano.xml, then I could pass that pano.xml file to krpano, and also a version parameter (optional).
    In this case, krpano would then apply ?v=versionumber to the get automatically when it downloads pano.xml, but also, for all the xml files which are included in pano.xml using the include statements, it would aso append the ?v=versionumber when downloading. And if possible, also for the images and other content defined in each of those xml files.
    That way, we can manage the version number in 1 place and krpano does the rest for us automatically. Hope this is more clear to understand what I mean.

  • I managed to implement some of this in my own code.
    In my wordpress plugin I added a field "version", and when the plugin embeds the krpano swf in a post, it automatically passes this version number to the swf via the javascript interface and the xml being loaded by the swf.
    inside my xml i have a "loadpanorama" function where I use the version number variable and append it to the url of the xml when I use krpano's loadpano function.
    However I'm left with 2 problems:
    1. I can't implement this for xml files which krpano loads via the "include" statements :(
    2. This is only for xml files and not other content such as images and sounds etc.
    If I had a way to append the version number to the url in the include statements automatically then it would be a big help. This is why if the versioning was implemented in krpano itself it would be better.

  • Hi,

    there is an undocumented behavior for urls that could help here:

    when using inside an url a sequence like this - %$XXX% - the XXX can be the name of a krpano variable, but with one limitation - the variable must be defined BEFORE the current xml/pano/scene,

    e.g. to avoid simply any caching urls like this are possible:

    Code
    url="file.xml?nocache=%$random%"

    or for versioning:
    define a "panoversion" variable in the html:

    Code
    viewer.addVariable("panoversion", ...);


    and in the xml:

    Code
    url="file.xml?v=%$panoversion%"

    (I will add that to the next documentation update)

    best regards,
    Klaus

  • Wow thanks Klaus! I have one question though, to set the variable, do I always have to use addVariable()? The way I pass the variable to krpano now in the script is after the embedpano function in html, I call the krpano.set() function to set the variable. Would this also work ok? Also I see there's a $ added to the variable name when refering to it in the include, not a typo right?

    Einmal editiert, zuletzt von KarelDonk (27. Oktober 2011 um 19:55)

  • I have a PHP generated page which displays pano viewer. when i edit the page and add more pan images and then rerun script to rebuild the pans, the new pans do not show on my page until i clear the browser cache. i tried to included some of the "add a query to url to prevent caching" tricks mentioned here, but they do not work.

    my code to display player is this:

    any suggestions?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!