Subscribe Bookmark RSS Feed

Is there a way to clear cache before opening online CSV link in JMP?

jason_paquette

Community Trekker

Joined:

Jan 26, 2015

Hello,

I have a database that allows for CSVs to be imported directly into JMP using the 'Open()' command.

dt = Open(http://.../csv.php?..., text);

I have had great success with this, but I have noticed that after the first run, JMP caches the initial dataset and I need to close and re-open JMP for the data to be extracted again.

I was wondering if there was a way to force JMP to clear cache and extract from url each run.

Thanks,

JP

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

If you can't fix the PHP script, you can add a parameter to the URL, something like "&random=" || char(randominteger(1,9999999))

Assuming "random" isn't a parameter the PHP script knows about, PHP won't care, but the cache will see a different URL and you'll get fresh data.

You could use today(), if you wait more than a second, rather than random.  Just something without spaces or special characters that changes.

Craige
3 REPLIES
msharp

Super User

Joined:

Jul 28, 2015

I'm not 100% sure this is what you want.  But 'clear globals();' and 'clear symbols();' will remove any variable associations.  And wait(0) will reset the cache.

It may be as simple as 'close(dt,nosave);'

Craige_Hales

Staff

Joined:

Mar 21, 2013

from PHP: header - Manual I don't know if this will fix it, but suspect it might.  If you are in control of the PHP script, give it a try.

Example #2 Caching directives

PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with:

<?php
header
("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
?>
Craige
Solution

If you can't fix the PHP script, you can add a parameter to the URL, something like "&random=" || char(randominteger(1,9999999))

Assuming "random" isn't a parameter the PHP script knows about, PHP won't care, but the cache will see a different URL and you'll get fresh data.

You could use today(), if you wait more than a second, rather than random.  Just something without spaces or special characters that changes.

Craige