Page 1 of 1

javascript caching issue

Posted: Thu Jun 01, 2006 7:02 pm
by always24x7
I am using some javascript to do some of the heavy lifting on the dom parsing from the data tag.

It appears that changes to the javascript are not being seen by the interpreter. Like it is caching the javascript.

I have put the vxml code inside a php program to prevent caching and that seems to work, but the javascript is an include in the vxml pitched by the php program.

ie: <script src="http://www.somedomain.com/ivr/util.js"/>

Is there a way to force this out of cache manually or to force it to load every time?

IVR example to force cache reset using maxage attribute

Posted: Sun Jun 04, 2006 10:35 am
by support
Hello,

The best way to force a cache reset is to use the maxage attribute or IVR *maxage global properties. For IVR example:

Code: Select all

<script src="http://www.somedomain.com/ivr/util.js" maxage="0"/>
This will tell our caching system to refresh the cache and get the latest copy. This attribute is available for all IVR tags that request data.

Regards,
Plum Support

Posted: Mon Jun 05, 2006 4:28 pm
by always24x7
I put the maxage="0" in one of my scripts, using the exact syntax below. It does not appear to work.

I put new functions in the javascript, but the vxml keeps saying they don't exist.

Is there any way to force it out of cache?

placement of maxage in IVR script

Posted: Tue Jun 06, 2006 10:58 am
by support
maxage="0" should not go into any of your IVR scripts. It should go into the IVR tag, <script>, that references your IVR scripts.

Can you paste in a snippet of your VoiceXML code that references your javascript page?

Posted: Tue Jun 06, 2006 1:20 pm
by always24x7
This problem has been worked around.

I built a small html page to use the functions in my included util.js and could not access it there either. After a bunch of trial and error I determined a couple of things:

One
====
<script src="http://www.somedomain.com/ivr/util.js" maxage="0"/>

Does not work reliably if there are other <script> tags in the html.
You have to use:
<script src="http://www.somedomain.com/ivr/util.js" maxage="0"></script>

What it was doing in the html was running the code in that <script> tag, but no other <script> tags if the </script> tag was missing. Putting the /> at the end was not sufficient. I believe I tested this in both IE and Firefox.

Two
===
If there are any syntax errors in a javascript function, it appears to not register that function.

The problem is, there is no easy way to debug that problem via the vxml interpreter. So the best way was to build a simple html page and access the functions with it until all the syntax errors have been found.