When including xml files or when you load xml files, there's always an issue of flash caching the xml. I solved it on different place in my html and by generating a number and use that as parameter to fake a new file. But I was wondering can't krpano do this automagicly? <include url="test.xml" nocache="true" />
first - there are two types of caching:
- the caching from the browser
that can't be controlled by krpano, but by sending the right http headers,
- and the krpano internal caching
there is a internal buffer that caches all kind of request files to avoid downloading the same file two times,
it can be disabled by:
but I wouldn't recommend that,
but a other solution is also possible - there is a way to use variables in paths (but these variables must be set or exists before),
this would be the template syntax: %$variable%
with that you could add a get request with a 'random' variable,
- the caching from the browser
Thanks Klaus :) That last one would solve alot of problems.
But a quick question, that random, generates a random number. but that would reload a file every time. Is it possible to give it a range based on time? For instance what I do in flash is generate a number based on the date on 1 jan 1970 in ms, divided in minutes (/6000) or 5 min (/30000). So that would create a number that changes every minute (and not every time. thats better for server caching. Would that be possible? (generating a number based on time?)
any variable could be used with that syntax in the url path,
but the variable must be set before loading the xml itself (variables that were set in the html will be set after when the loading of the xml was done)
e.g. in dynamic code:
and in the xml there:
why do you need refreshes every time?
is your xml so dynamic?
if it's just for testing I would recommend just to clear the browser cache after each change...
No I dont want it to refresh everytime.
Let me describe our common situation:
We Build a tour,
customer has feedback. I dont like this color, can you make the hotspots bigger, the text has a type etc
we edit the tour,
upload to the same folder,
Customer says, I dont see things altered.
Now my boss asked me to come up with a solution for this common problem.
So I want the tour refresh certain elements (or just plain everything). But not EVERYTIME, Not Every click, Not every panorama. I can imagine a user spending 6min in a tour, clicking a round, but you dont want to reload every reusable element of the interface, or reloading globalconfiguration.xml thats included in every panorama xml.
But on my end, I dont want to edit some variable to a higher number (version number) and cross reference that to see if stuff changed. Nor do I want to upload new content to a new folder or different way.
So my solution was in my Flash interface, a timestamp that changes every 5min by taking the date from 1 jan 1970 (new Date()) and divide that with 5 * 60 * 1000 (5min in ms). So it has a new variable every 5min. This works fine for the Interface bits, but a great deal is still handled in krpano, and now Im looking for a similar solution I did in my Flash interface.
okay, I understand, but ...
when the server sends the last-modified date and cache-control settings, this shouldn't be necessary,
then a simple refresh of the page should be enough... (or?)