cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar

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

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
Craige_Hales
Super User

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

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

View solution in original post

3 REPLIES 3
msharp
Super User (Alumni)

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

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
Super User

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

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
Craige_Hales
Super User

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

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