You are not logged in.

Dear visitor, welcome to krpano.com Forum. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

1

Wednesday, July 14th 2010, 12:25pm

cachebuster

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" />
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

2

Thursday, July 15th 2010, 2:42pm

Hi,

first - there are two types of caching:
  1. the caching from the browser
    that can't be controlled by krpano, but by sending the right http headers,


  2. 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:

    Source code

    1
    
    <network caching="false" />

    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,
e.g

Source code

1
<include url="test.xml?%$random%" />


best regards,
Klaus

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

3

Thursday, July 15th 2010, 9:22pm

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?)
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

4

Friday, July 16th 2010, 10:28am

Hi,

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:

Source code

1
2
set(timestamp, ....);
loadpano(...);


and in the xml there:

Source code

1
<include url="test.xml?%$timestamp%" />


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...

best regards,
Klaus

Zephyr

Professional

  • "Zephyr" started this thread

Posts: 994

Location: Netherlands

Occupation: Web developer

  • Send private message

5

Friday, July 16th 2010, 1:54pm

No I dont want it to refresh everytime.

Let me describe our common situation:

We Build a tour,
upload it,
email customer,
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,
email customer
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.

The set(timestamp, ... ); loadpano etc could work if I could generate a number every 5min (like I do in flash). Is this possible, or should I look @ javascript solution. Or should I make a function callback to my interface and let flash generate that number and send it back to krpano (seems slow)
3d childrens game using krpano Game
Minify your xml with my krpano XML Compressor
Krpano XML Parsing Error Checklist
Available for hire (krpano xml, javascript, actionscript, flash, php and ipad plugins).

6

Monday, July 19th 2010, 2:08pm

Hi,

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?)

btw - the Javascript interface is not that slow
e.g. here the Javascript interface is called up to 2x60 times per second:
http://krpano.com/examples/javascriptsync/

best regards,
Klaus